Set-CMMaintenanceWindow

Modifies a maintenance window.

Syntax

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

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

-CollectionId

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

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

Specifies the name of the maintenance window.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InputObject
Type:IResultObject
Aliases:Collection, Site
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-MaintenanceWindow
Type:IResultObject
Aliases:ScheduleWindow
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
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
-PassThru

Returns the current working object. By default, this cmdlet does not generate any output.

Type:SwitchParameter
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
-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