New-CMMaintenanceWindow

New-CMMaintenanceWindow

Creates a maintenance window for a collection.

構文

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

詳細説明

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.

パラメーター

-ApplyToSoftwareUpdateOnly

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ApplyToTaskSequenceOnly

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CollectionID<String>

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

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Name<String>

Specifies the name of the maintenance window.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

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 

関連トピック

Get-CMMaintenanceWindow

Remove-CMMaintenanceWindow

Set-CMMaintenanceWindow

New-CMSchedule