New-CMMaintenanceWindow

System Center 2012 R2

New-CMMaintenanceWindow

Creates a maintenance window for a collection.

Syntax

Parameter Set: ByScheduleMandatory
New-CMMaintenanceWindow [-CollectionID] <String> -Name <String> -Schedule <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SoftwareUpdateOnly
New-CMMaintenanceWindow [-CollectionID] <String> -ApplyToSoftwareUpdateOnly -Name <String> -Schedule <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: TaskSequenceOnly
New-CMMaintenanceWindow [-CollectionID] <String> -ApplyToTaskSequenceOnly -Name <String> -Schedule <IResultObject> [-Confirm] [-WhatIf] [ <CommonParameters>]




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

Parameters

-ApplyToSoftwareUpdateOnly

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


Aliases

none

Required?

true

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.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CollectionID<String>

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


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-Name<String>

Specifies the name of the maintenance window.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Schedule<IResultObject>

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


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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


Required?

false

Position?

named

Default Value

false

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 (http://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.

Examples

Example 1: Create a maintenance window

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.


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 

Related topics

Community Additions

ADD
Show: