Set-WBSchedule

Set-WBSchedule

Sets the current schedule for backups.

構文

Parameter Set: Default
Set-WBSchedule [-Policy] <WBPolicy> [-Schedule] <DateTime[]> [ <CommonParameters>]

詳細説明

The Set-WBSchedule cmdlet sets the current schedule for backups and saves the settings in the WBPolicy object.

The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode, use the Get-WBPolicy cmdlet with the Editable parameter. The New-WBPolicy cmdlet creates a WBPolicy object that is already in edit mode.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

パラメーター

-Policy<WBPolicy>

Specifies the WBPolicy object to update.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

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

True (ByPropertyName)

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

false

-Schedule<DateTime[]>

Specifies the times of day to create a backup. Time values are formatted as HH:MM and separated by a comma.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

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

True (ByPropertyName)

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

false

<CommonParameters>

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

入力

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

  • WBPolicy,Datetime []

    The Set-WBSchedule cmdlet references a Datetime object for the scheduled times and the WBPolicy object for the backup policy to update.

出力

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

  • DateTime[]

    The Set-WBSchedule cmdlet returns the Datetime list that you use to update the policy.

Example 1: Set a backup policy schedule

This command sets the scheduled times to create backups and saves the information in the WBPolicy object. When you set this policy on the computer, backups are created daily at the specified times.

The first command stores the result of the Get-WBPolicy in the variable named $Policy.

The second command sets the backup schedule in the $Policy variable. The Schedule parameter indicates the times.

PS C:\> $Policy = Get-WBPolicy
PS C:\> Set-WBSchedule -Policy $Policy -Schedule 12:00,09:00

関連トピック

Get-WBPolicy

Get-WBSchedule