New-CMMaintenanceWindow

Creates a maintenance window for a collection.

Syntax

New-CMMaintenanceWindow
   [-CollectionId] <String>
   [-IsEnabled <Boolean>]
   -Schedule <IResultObject>
   -Name <String>
   [-ApplyTo <MaintenanceWindowApplyTo>]
   [-ApplyToTaskSequenceOnly]
   [-ApplyToSoftwareUpdateOnly]
   [-IsUtc <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMMaintenanceWindow
   [-CollectionName] <String>
   [-IsEnabled <Boolean>]
   -Schedule <IResultObject>
   -Name <String>
   [-ApplyTo <MaintenanceWindowApplyTo>]
   [-ApplyToTaskSequenceOnly]
   [-ApplyToSoftwareUpdateOnly]
   [-IsUtc <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-CMMaintenanceWindow
   [-InputObject] <IResultObject>
   [-IsEnabled <Boolean>]
   -Schedule <IResultObject>
   -Name <String>
   [-ApplyTo <MaintenanceWindowApplyTo>]
   [-ApplyToTaskSequenceOnly]
   [-ApplyToSoftwareUpdateOnly]
   [-IsUtc <Boolean>]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-CMMaintenanceWindow cmdlet creates a maintenance window for a collection. Maintenance windows are periods of time reserved for write operations such as applying software updates, installing software, or configuring computer settings.

Examples

Example 1: Create a maintenance window

PS C:\> $MWSchedule = New-CMSchedule -DayOfWeek Friday -DurationCount 0 -DurationInterval Hours -RecurCount 1 -Start "10/12/2013 21:00:00"
PS C:\> New-CMMaintenanceWindow -CollectionID "AAA0005D" -Name "MonthlySchedule" -Schedule $MWSchedule

The first command uses the New-CMSchedule cmdlet to create a schedule object, and then stores it in the $MWSchedule variable.

The second command creates a maintenance window named MonthlySchedule for the specified collection. The maintenance window uses the schedule stored in the $MWSchedule variable.

Required Parameters

-CollectionId

Specifies the ID of the collection that the maintenance window applies to.

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CollectionName
Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject

Specifies the input to this cmdlet. You can use this parameter, or you can pipe the input to this cmdlet.

Type:IResultObject
Aliases:Collection, Site
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Name

Specifies the name of the maintenance window.

Type:String
Aliases:MaintenanceWindowName
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Schedule

Specifies a CMSchedule object. The schedule specifies when the maintenance window occurs. To create a CMSchedule object, use the New-CMSchedule cmdlet.

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

Optional Parameters

-ApplyTo
Type:MaintenanceWindowApplyTo
Parameter Sets:Any, SoftwareUpdatesOnly, TaskSequencesOnly
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ApplyToSoftwareUpdateOnly

Indicates that the maintenance window is used to apply software updates only.

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

Indicates that the maintenance window is used to apply task sequences only.

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

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

DisableWildcardHandling treats wildcard characters as literal character values. Cannot be combined with ForceWildcardHandling.

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

ForceWildcardHandling processes wildcard characters and may lead to unexpected behavior (not recommended). Cannot be combined with DisableWildcardHandling.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsEnabled
Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IsUtc
Type:Boolean
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False