Set-CMMaintenanceWindow

Modifies a maintenance window.

Syntax

Set-CMMaintenanceWindow
   [-ApplyTo <MaintenanceWindowApplyTo>]
   [-ApplyToSoftwareUpdateOnly]
   [-ApplyToTaskSequenceOnly]
   -Collection <IResultObject>
   [-Confirm]
   [-DisableWildcardHandling]
   [-ForceWildcardHandling]
   [-IsEnabled <Boolean>]
   -MaintenanceWindow <IResultObject>
   [-PassThru]
   [-Schedule <IResultObject>]
   [-WhatIf]
   [<CommonParameters>]
Set-CMMaintenanceWindow [-ApplyTo ] [-ApplyToSoftwareUpdateOnly]
 [-ApplyToTaskSequenceOnly] -Collection  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-IsEnabled ] -MaintenanceWindowName  [-PassThru]
 [-Schedule ] [-WhatIf] []
Set-CMMaintenanceWindow [-ApplyTo ] [-ApplyToSoftwareUpdateOnly]
 [-ApplyToTaskSequenceOnly] -CollectionId  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-IsEnabled ] -MaintenanceWindowName  [-PassThru]
 [-Schedule ] [-WhatIf] []
Set-CMMaintenanceWindow [-ApplyTo ] [-ApplyToSoftwareUpdateOnly]
 [-ApplyToTaskSequenceOnly] -CollectionId  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-IsEnabled ] -MaintenanceWindow  [-PassThru]
 [-Schedule ] [-WhatIf] []
Set-CMMaintenanceWindow [-ApplyTo ] [-ApplyToSoftwareUpdateOnly]
 [-ApplyToTaskSequenceOnly] -CollectionName  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-IsEnabled ] -MaintenanceWindow  [-PassThru]
 [-Schedule ] [-WhatIf] []
Set-CMMaintenanceWindow [-ApplyTo ] [-ApplyToSoftwareUpdateOnly]
 [-ApplyToTaskSequenceOnly] -CollectionName  [-Confirm] [-DisableWildcardHandling]
 [-ForceWildcardHandling] [-IsEnabled ] -MaintenanceWindowName  [-PassThru]
 [-Schedule ] [-WhatIf] []

Description

The Set-CMMaintenanceWindow cmdlet modifies a maintenance window associated with 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: Modify a maintenance window

PS C:\> Set-CMMaintenanceWindow -Name "DiskCleanup"-CollectionID "AAA0004D" -ApplyToTaskSequenceOnly

This command modifies the maintenance window named DiskCleanup, a window associated with the collection AAA0004D. In this example, the maintenance window is configured to apply only to task sequences.

Required Parameters

-Collection

Specifies a Configuration Manager maintenance window object. To obtain a maintenance window object, use the Get-CMMaintenanceWindow cmdlet.

Type:IResultObject
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-CollectionId

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

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

Specifies the name of the maintenance window.

Type:String
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-MaintenanceWindow
Type:IResultObject
Aliases:ScheduleWindow
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-MaintenanceWindowName

Specifies the name of the maintenance window.

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

Optional Parameters

-ApplyTo
Type:MaintenanceWindowApplyTo
Parameter Sets:Any, SoftwareUpdatesOnly, TaskSequencesOnly
Required:False
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
Required:False
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
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-DisableWildcardHandling

Indicates that wildcard handling is disabled.

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

Indicates that wildcard handling is enabled.

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

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Type:SwitchParameter
Required:False
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
Required:False
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
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False