Enable-WmsScheduledUpdate

Enables scheduled updates while disk protection is enabled and in discard mode.

Syntax

Enable-WmsScheduledUpdate
      [-AutomaticUpdateMode <EAutomaticUpdateMode>]
      [-HourToScheduleUpdates <UInt32>]
      [-CustomScript <String>]
      [-MaxTimeAllowedForCustomScript <UInt32>]
      [-ReturnState <EScheduleUpdateReturnState>]
      [-Server <String>]
      [<CommonParameters>]

Description

The Enable-WmsScheduledUpdate cmdlet enables the specified computer to periodically disable the disk protection feature so that scheduled updates can be applied. After updates are applied, the disk protection feature is automatically re-enabled.

Examples

Example 1: Enable scheduled updates

PS C:\> Enable-WmsScheduledUpdate -Server "Sample.microsoft.com" -AutomaticUpdateMode WindowsOnly -HourToScheduleUpdates 3 -CustomScript "C:\MyApps\SampleApp.exe" -MaxTimeAllowedForCustomScript 30 -ReturnState PreviousState
IsScheduleUpdateEnabled       : True
AutomaticUpdateMode           : WindowsOnly
HourToScheduleUpdates         : 3
CustomScript                  : c:\myapps\sampleapp.exe
MaxTimeAllowedForCustomScript : 30
ReturnState                   : PreviousState

This command enables the computer Sample.microsoft.com to switch disk protection to passive mode (reboot) at 3 AM to apply any pending Windows updates and run the application SampleApp.exe. The system then returns to the power/running state it was in before 3 AM.

Parameters

-AutomaticUpdateMode

Specifies the type of automatic updates to process. The acceptable values for this parameter are:

  • None
  • WindowsOnly
  • WindowsAndOtherPrograms
Type:EAutomaticUpdateMode
Accepted values:None, WindowsOnly, WindowsAndOtherPrograms
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-CustomScript

Specifies the full path of a user-supplied command to run at update time.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-HourToScheduleUpdates

Specifies the hour at which to run automatic updates. The acceptable values for this parameter are: 0-23.

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-MaxTimeAllowedForCustomScript

Specifies the maximum amount of time that the custom script is allowed to run. After this amount of time expires, the process is stopped and the system is restarted to re-enable disk protection.

Type:UInt32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ReturnState

Specifies the state in which to place the computer after updates are complete. The acceptable values for this parameter are: Shutdown and PreviousState.

Type:EScheduleUpdateReturnState
Accepted values:Shutdown, PreviousState
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Server

Specifies the fully qualified host name of the MultiPoint Server that is the target of the command. The default is localhost.

Type:String
Aliases:ComputerName
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

scheduledUpdate

This cmdlet returns a structure containing the current configuration.