Add-WBBackupTarget

Add-WBBackupTarget

Adds a backup target to a backup policy.

構文

Parameter Set: Default
Add-WBBackupTarget [-Policy] <WBPolicy> [-Target] <WBBackupTarget> [[-Force]] [ <CommonParameters>]

詳細説明

The Add-WBBackupTarget cmdlet adds a WBBackupTarget object, which specifies backup storage locations, to a WBPolicy object that contains a backup policy. To use this cmdlet, you must first use the New-WBBackupTarget cmdlet to create a WBBackupTarget object. You can then use the Add-WBBackupTarget cmdlet to specify the storage location by using a disk, a volume, or a remote shared folder (network) location.

Before you can add a backup target to a WBPolicy object, you must make sure that the WBPolicy object is in edit mode. To put the WBPolicy object in edit mode for a policy that you have set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the -Editable parameter. The New-WBPolicy cmdlet creates a new WBPolicy object that is already in edit mode.

If you specify a disk as a storage location for backups, the server formats the disk before it uses the disk and permanently deletes any existing data on the disk.

You can add only one storage type at a time to a policy. If you specify a shared folder as the storage location, you cannot add more locations because you can specify only one shared folder as a storage location at any time. However, you can specify multiple disks or volumes at one time by calling Add-WBBackupTarget for each location.

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

パラメーター

-Force

Indicates that the cmdlet adds the backup target without prompting you for confirmation. By default, the cmdlet prompts you for confirmation before it proceeds.

エイリアス

なし

必須?

false

位置は?

3

既定値

なし

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

false

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

false

-Policy<WBPolicy>

Specifies a backup policy object that contains the backup policy to update.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

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

True (ByPropertyName)

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

false

-Target<WBBackupTarget>

Specifies a backup target object that contains the backup storage location to add to the backup policy.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

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

True (ByPropertyName)

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

false

<CommonParameters>

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

入力

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

  • WBBackupTarget, WBPolicy

    The Add-WBBackupTarget cmdlet adds a WBBackupTarget object, which contains new backup storage locations, to a WBPolicy object that contains a backup policy. To add more than one storage location, you must call Add-WBBackupTarget separately for each location.

出力

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

  • WBBackupTarget[]

    The Add-WBBackupTarget cmdlet displays a list of storage locations from the WBPolicy objects that contain the backup policies.

Example 1: Add a backup storage location to a backup policy

This example adds a backup storage location to a backup policy.

The first command gets the current backup policy and stores it in a variable named $Policy.

The second command adds the backup storage location in the variable named $BackupLocation to the WBPolicy object in the variable named $Policy. You can create the backup target that you add to the location in the $BackupLocation variable by using the New-WBBackupTarget cmdlet.

PS C:\> $Policy = Get-WBPolicy
PS C:\> Add-WBBackupTarget -Policy $Policy -Target $BackupLocation

関連トピック

Get-WBBackupTarget

Get-WBPolicy

New-WBBackupTarget

New-WBPolicy

Remove-WBBackupTarget