Set-SCServicingWindow

Set-SCServicingWindow

Modifies the properties of a servicing window.

Syntax

Parameter Set: NoFrequencyUpdate
Set-SCServicingWindow [-ServicingWindow] <ServicingWindow> [-Category <String> ] [-Description <String> ] [-JobVariable <String> ] [-MinutesDuration <Int32> ] [-Name <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-StartDate <DateTime> ] [-StartTimeOfDay <DateTime> ] [-TimeZone <Int32]> ] [ <CommonParameters>]

Parameter Set: DailyFrequency
Set-SCServicingWindow [-ServicingWindow] <ServicingWindow> -DaysToRecur <Int32> [-Category <String> ] [-Description <String> ] [-JobVariable <String> ] [-MinutesDuration <Int32> ] [-Name <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-StartDate <DateTime> ] [-StartTimeOfDay <DateTime> ] [-TimeZone <Int32]> ] [ <CommonParameters>]

Parameter Set: MonthlyFrequency
Set-SCServicingWindow [-ServicingWindow] <ServicingWindow> -DayOfMonth <DayOfMonthType> {First | DayTwo | DayThree | DayFour | DayFive | DaySix | DaySeven | DayEight | DayNine | DayTen | DayEleven | DayTweleve | DayThirteen | DayFourteen | DayFifteen | DaySixteen | DaySeventeen | DayEighteen | DayNineteen | DayTwenty | DayTwentyOne | DayTwentyTwo | DayTwentyThree | DayTwentyFour | DayTwentyFive | DayTwentySix | DayTwentySeven | DayTwentyEight | DayTwentyNine | DayThirty | DayThirtyOne | Last} [-Category <String> ] [-Description <String> ] [-JobVariable <String> ] [-MinutesDuration <Int32> ] [-MonthsToRecur <Int32> ] [-Name <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-StartDate <DateTime> ] [-StartTimeOfDay <DateTime> ] [-TimeZone <Int32]> ] [ <CommonParameters>]

Parameter Set: MonthlyRelativeFrequency
Set-SCServicingWindow [-ServicingWindow] <ServicingWindow> -MonthlyScheduleDayOfWeek <DayOfWeek> {Sunday | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday} -WeekOfMonth <WeekOfMonthType> {First | Second | Third | Fourth | Last} [-Category <String> ] [-Description <String> ] [-JobVariable <String> ] [-MinutesDuration <Int32> ] [-MonthsToRecur <Int32> ] [-Name <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-StartDate <DateTime> ] [-StartTimeOfDay <DateTime> ] [-TimeZone <Int32]> ] [ <CommonParameters>]

Parameter Set: WeeklyFrequency
Set-SCServicingWindow [-ServicingWindow] <ServicingWindow> -WeeklyScheduleDayOfWeek <String> [-Category <String> ] [-Description <String> ] [-JobVariable <String> ] [-MinutesDuration <Int32> ] [-Name <String> ] [-Owner <String> ] [-PROTipID <Guid]> ] [-RunAsynchronously] [-StartDate <DateTime> ] [-StartTimeOfDay <DateTime> ] [-TimeZone <Int32]> ] [-WeeksToRecur <Int32> ] [ <CommonParameters>]

Detailed Description

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

Parameters

-Category<String>

Specifies a category for a servicing window.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DayOfMonth<DayOfMonthType>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-DaysToRecur<Int32>

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

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Description<String>

States a description for the specified object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-JobVariable<String>

Specifies that job progress is tracked and stored in the variable named by this parameter.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MinutesDuration<Int32>

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: -MinutesDuration 120

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MonthlyScheduleDayOfWeek<DayOfWeek>

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, then Tuesday is the default. If you specify this parameter, you must also specify the WeekOfMonth parameter. Valid values are:

-- Monday
-- Tuesday
-- Wednesday
-- Thursday
-- Friday
-- Saturday
-- Sunday

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-MonthsToRecur<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of a VMM object.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Owner<String>

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"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-PROTipID<Guid]>

Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ServicingWindow<ServicingWindow>

Specifies a servicing window object.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-StartDate<DateTime>

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 DateTime 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"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-StartTimeOfDay<DateTime>

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 hours from 6:00pm: -StartTimeOfDay "18:00-20:00"

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-TimeZone<Int32]>

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 (https://go.microsoft.com/fwlink/?LinkId=120935) on the Microsoft Developer Network. 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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WeeklyScheduleDayOfWeek<String>

Specifies one or more days of the week to run a job. If you specify this parameter, you must specify the StartTimeOfDay parameter. 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)

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WeekOfMonth<WeekOfMonthType>

Specifies a week relative to the first day of the month, such as first, second, third, fourth, or last.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WeeksToRecur<Int32>

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • ServicingWindow

Examples

Example 1: Change the start time of a servicing window

The first command gets the servicing window object named Backup Staging A, and then stores the object in the $SvcWindow variable.

The second command changes the start time of the servicing window stored in $SvcWindow to 1:00 PM GMT Standard Time.

PS C:\> $SvcWindow = Get-SCServicingWindow -Name "Backup Staging A"
PS C:\> Set-SCServicingWindow -ServicingWindow $SvcWindow -StartTimeOfDay "13:00" -TimeZone 085

Get-SCServicingWindow

New-SCServicingWindow

Remove-SCServicingWindow