Set-SCServicingWindow

Modifies the properties of a servicing window.

Syntax

Set-SCServicingWindow
   [-ServicingWindow] <ServicingWindow>
   [-Name <String>]
   [-Description <String>]
   [-Category <String>]
   [-Owner <String>]
   [-TimeZone <Int32>]
   [-StartDate <DateTime>]
   [-StartTimeOfDay <DateTime>]
   [-MinutesDuration <Int32>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCServicingWindow
   [-ServicingWindow] <ServicingWindow>
   [-Name <String>]
   [-Description <String>]
   [-Category <String>]
   [-Owner <String>]
   [-TimeZone <Int32>]
   [-StartDate <DateTime>]
   [-StartTimeOfDay <DateTime>]
   -WeeklyScheduleDayOfWeek <String>
   [-WeeksToRecur <Int32>]
   [-MinutesDuration <Int32>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCServicingWindow
   [-ServicingWindow] <ServicingWindow>
   [-Name <String>]
   [-Description <String>]
   [-Category <String>]
   [-Owner <String>]
   [-TimeZone <Int32>]
   [-StartDate <DateTime>]
   [-StartTimeOfDay <DateTime>]
   -MonthlyScheduleDayOfWeek <DayOfWeek>
   -WeekOfMonth <WeekOfMonthType>
   [-MonthsToRecur <Int32>]
   [-MinutesDuration <Int32>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCServicingWindow
   [-ServicingWindow] <ServicingWindow>
   [-Name <String>]
   [-Description <String>]
   [-Category <String>]
   [-Owner <String>]
   [-TimeZone <Int32>]
   [-StartDate <DateTime>]
   [-StartTimeOfDay <DateTime>]
   -DayOfMonth <DayOfMonthType>
   [-MonthsToRecur <Int32>]
   [-MinutesDuration <Int32>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]
Set-SCServicingWindow
   [-ServicingWindow] <ServicingWindow>
   [-Name <String>]
   [-Description <String>]
   [-Category <String>]
   [-Owner <String>]
   [-TimeZone <Int32>]
   [-StartDate <DateTime>]
   [-StartTimeOfDay <DateTime>]
   -DaysToRecur <Int32>
   [-MinutesDuration <Int32>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

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

Examples

Example 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.

Required Parameters

-DayOfMonth

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 - 31

Valid string values: First, Last

Type:DayOfMonthType
Parameter Sets: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
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DaysToRecur

Specifies the amount of time, in days, between scheduled jobs. The default value is the minimum of one (1). The maximum value is 999.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MonthlyScheduleDayOfWeek

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). The acceptable values for this parameter are:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday

Requirement: Use with the WeekOfMonth parameter.

Type:DayOfWeek
Parameter Sets:Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServicingWindow

Specifies a servicing window object.

Type:ServicingWindow
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WeekOfMonth

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

Type:WeekOfMonthType
Parameter Sets:First, Second, Third, Fourth, Last
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WeeklyScheduleDayOfWeek

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

Requirement: Use with StartTimeOfDay.

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

Optional Parameters

-Category

Specifies a category for a servicing window.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies a description for the servicing window.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

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

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MinutesDuration

Specifies a period of time in minutes. Use this parameter to specify the amount of time for which to put a server or service into maintenance mode.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MonthsToRecur

Specifies the amount of time, in months, between scheduled service windows. The default value is the minimum value of one (1). There is no maximum value.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Name

Specifies the name of a Virtual Machine Manager (VMM) object.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Owner

Specifies the owner of a VMM object in the form of a valid domain user account.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
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.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartDate

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.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartTimeOfDay

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.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeZone

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.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WeeksToRecur

Specifies the amount of time, in weeks, between scheduled jobs. The default value is the minimum value of one (1). There is no maximum value.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

ServicingWindow

This cmdlet returns a ServicingWindow object.