Set-SCServicingWindow

Modifies the properties of a servicing window.

Description

The Set-SCServicingWindow cmdlet modifies the properties of a servicing window, including the schedule for the servicing window.

For more information about Set-SCServicingWindow, type: "Get-Help Set-SCServicingWindow -online".

Parameters

ServicingWindow

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a servicing window object.

DaysToRecur

Required? true
Accept Pipeline Input? false
Position? named
Specifies, in days, the amount of time between scheduled jobs. 

Minimum value: 1
Maximum value: 999
Default value: 1

Example format (to schedule a job to recur every third day): -DaysToRecur 3

Category

Required? false
Accept Pipeline Input? false
Position? named
Specifies a category for a servicing window.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

MinutesDuration

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in minutes, a period of time. For example, when used with New-SCServicingWindow or Set-SCServicingWindow, use this parameter to specify the amount of time for which to put a server or service into maintenance mode.

Example format: -DurationMinutes 120

Name

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of a VMM object.

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

StartDate

Required? false
Accept Pipeline Input? false
Position? named
Specifies the date to start a service window. The default value is the current date. You can type a new date in the short date format for your locale. Or, you can pass a Date-Time object from Get-Date.

Example format that specifies a DateTime object:
  $StartDate = Get-Date -Year 2012 -Day 5 -Month 4
  -StartDate $StartDate

Example formats that specifies a string:
  -StartDate “August 19, 2011”
  -StartDate “8/19/2011”

StartTimeOfDay

Required? false
Accept Pipeline Input? false
Position? named
Specifies the time of day, or a time-span during a 24-hour period, to start a job or other operation. The default value is the current time.

Example format: -StartTimeOfDay “08:00”
Example format for 2 hrs from 6:00pm: -StartTimeOfDay "18:00-20:00"

TimeZone

Required? false
Accept Pipeline Input? false
Position? named
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see "Microsoft Time Zone Index Values" at: http://go.microsoft.com/fwlink/?LinkId=120935. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.

Example format to specify the GMT Standard Time zone: -TimeZone 085

ServicingWindow

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a servicing window object.

DayOfMonth

Required? true
Accept Pipeline Input? false
Position? named
Specifies the ordinal day of the month on which the schedule starts. For example, 4 indicates the fourth day of the month. "Last" indicates the last day of the month. 

The default value is the integer that corresponds to the same day as specified in the StartDate parameter.

Valid integer values: 1 through 31.
Valid string values:  "First", "Last"

Category

Required? false
Accept Pipeline Input? false
Position? named
Specifies a category for a servicing window.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

MinutesDuration

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in minutes, a period of time. For example, when used with New-SCServicingWindow or Set-SCServicingWindow, use this parameter to specify the amount of time for which to put a server or service into maintenance mode.

Example format: -DurationMinutes 120

MonthsToRecur

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in months, the amount of time between scheduled service windows

Minimum value: 1
Maximum value: None
Default value: 1

Example format (to schedule a service window to recur every other month): -MonthsToRecur 2

Name

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of a VMM object.

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

StartDate

Required? false
Accept Pipeline Input? false
Position? named
Specifies the date to start a service window. The default value is the current date. You can type a new date in the short date format for your locale. Or, you can pass a Date-Time object from Get-Date.

Example format that specifies a DateTime object:
  $StartDate = Get-Date -Year 2012 -Day 5 -Month 4
  -StartDate $StartDate

Example formats that specifies a string:
  -StartDate “August 19, 2011”
  -StartDate “8/19/2011”

StartTimeOfDay

Required? false
Accept Pipeline Input? false
Position? named
Specifies the time of day, or a time-span during a 24-hour period, to start a job or other operation. The default value is the current time.

Example format: -StartTimeOfDay “08:00”
Example format for 2 hrs from 6:00pm: -StartTimeOfDay "18:00-20:00"

TimeZone

Required? false
Accept Pipeline Input? false
Position? named
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see "Microsoft Time Zone Index Values" at: http://go.microsoft.com/fwlink/?LinkId=120935. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.

Example format to specify the GMT Standard Time zone: -TimeZone 085

ServicingWindow

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a servicing window object.

MonthlyScheduleDayOfWeek

Required? true
Accept Pipeline Input? false
Position? named
Specifies the day of the week to run a job that occurs on a monthly schedule. You can specify only one day of the week. The default value is the current day (if today is Tuesday, Tuesday is the default). Valid values to specify a specific day are: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

Requirement: Use with the parameter WeekOfMonth. 

WeekOfMonth

Required? true
Accept Pipeline Input? false
Position? named
Specifies a week relative to the first day of the month, such as first, second, third, fourth, or last.

Category

Required? false
Accept Pipeline Input? false
Position? named
Specifies a category for a servicing window.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

MinutesDuration

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in minutes, a period of time. For example, when used with New-SCServicingWindow or Set-SCServicingWindow, use this parameter to specify the amount of time for which to put a server or service into maintenance mode.

Example format: -DurationMinutes 120

MonthsToRecur

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in months, the amount of time between scheduled service windows

Minimum value: 1
Maximum value: None
Default value: 1

Example format (to schedule a service window to recur every other month): -MonthsToRecur 2

Name

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of a VMM object.

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

StartDate

Required? false
Accept Pipeline Input? false
Position? named
Specifies the date to start a service window. The default value is the current date. You can type a new date in the short date format for your locale. Or, you can pass a Date-Time object from Get-Date.

Example format that specifies a DateTime object:
  $StartDate = Get-Date -Year 2012 -Day 5 -Month 4
  -StartDate $StartDate

Example formats that specifies a string:
  -StartDate “August 19, 2011”
  -StartDate “8/19/2011”

StartTimeOfDay

Required? false
Accept Pipeline Input? false
Position? named
Specifies the time of day, or a time-span during a 24-hour period, to start a job or other operation. The default value is the current time.

Example format: -StartTimeOfDay “08:00”
Example format for 2 hrs from 6:00pm: -StartTimeOfDay "18:00-20:00"

TimeZone

Required? false
Accept Pipeline Input? false
Position? named
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see "Microsoft Time Zone Index Values" at: http://go.microsoft.com/fwlink/?LinkId=120935. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.

Example format to specify the GMT Standard Time zone: -TimeZone 085

ServicingWindow

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a servicing window object.

WeeklyScheduleDayOfWeek

Required? true
Accept Pipeline Input? false
Position? named
Specifies one or more days of the week to run a job. The default value is the current day of the week. Valid values to specify an individual day by using a string: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. Valid values to specify a set of days in a week: Any set of two or more days separated by commas. Valid values to specify an individual day by using an integer: 1, 2, 3, 4, 5, 6, 7

Example format: -WeeklyScheduleDayOfWeek “Monday”
Example format: -WeeklyScheduleDayOfWeek “Monday, Wednesday, Friday”
Example format: -WeeklyScheduleDayOfWeek 5 (to specify a Friday)

Requirement: Use with StartTimeOfDay.

Category

Required? false
Accept Pipeline Input? false
Position? named
Specifies a category for a servicing window.

Description

Required? false
Accept Pipeline Input? false
Position? named
States a description for the specified object.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

MinutesDuration

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in minutes, a period of time. For example, when used with New-SCServicingWindow or Set-SCServicingWindow, use this parameter to specify the amount of time for which to put a server or service into maintenance mode.

Example format: -DurationMinutes 120

Name

Required? false
Accept Pipeline Input? false
Position? named
Specifies the name of a VMM object.

Owner

Required? false
Accept Pipeline Input? false
Position? named
Specifies the owner of a VMM object in the form of a valid domain user account.

Example format: -Owner "Contoso\ReneeLo"
Example format: -Owner "ReneeLo@Contoso"

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

StartDate

Required? false
Accept Pipeline Input? false
Position? named
Specifies the date to start a service window. The default value is the current date. You can type a new date in the short date format for your locale. Or, you can pass a Date-Time object from Get-Date.

Example format that specifies a DateTime object:
  $StartDate = Get-Date -Year 2012 -Day 5 -Month 4
  -StartDate $StartDate

Example formats that specifies a string:
  -StartDate “August 19, 2011”
  -StartDate “8/19/2011”

StartTimeOfDay

Required? false
Accept Pipeline Input? false
Position? named
Specifies the time of day, or a time-span during a 24-hour period, to start a job or other operation. The default value is the current time.

Example format: -StartTimeOfDay “08:00”
Example format for 2 hrs from 6:00pm: -StartTimeOfDay "18:00-20:00"

TimeZone

Required? false
Accept Pipeline Input? false
Position? named
Specifies a number (an index) that identifies a geographical region that shares the same standard time. For a list of time zone indexes, see "Microsoft Time Zone Index Values" at: http://go.microsoft.com/fwlink/?LinkId=120935. If no time zone is specified, the default time zone used for a virtual machine is the same time zone setting that is on the virtual machine host.

Example format to specify the GMT Standard Time zone: -TimeZone 085

WeeksToRecur

Required? false
Accept Pipeline Input? false
Position? named
Specifies, in weeks, the amount of time between scheduled jobs.

Minimum value: 1
Maximum value: None
Default value: 1

Example format (to schedule a job to recur every other week): -WeeksToRecur 2

Examples

1: Change the start time of a servicing window.
PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A" 
PS C:\> Set-SCServicingWindow -ServicingWindow $SvcWindow -StartTimeOfDay "13:00" -TimeZone 085
The first command gets the servicing window object named Backup Staging A and stores the object in the $SvcWindow variable.

The second command changes the start time of the servicing window stored in $SvcWindow (Backup Staging A) to 1:00 PM in the GMT Standard time zone.

See Also