Remove-WBBackupTarget

Remove-WBBackupTarget

Removes backup storage locations from a backup policy.

構文

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




詳細説明

The Remove-WBBackupTarget cmdlet removes backup storage locations from a backup policy. WBBackupTarget objects define backup storage locations. A WBPolicy object defines the backup policy.

Before you can remove a backup target from a WBPolicy object, you must put the WBPolicy object 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 use 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 the Add-WBBackupTarget cmdlet for each location.

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

パラメーター

-Policy<WBPolicy>

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


エイリアス

なし

必須?

true

位置は?

1

既定値

なし

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

True (ByPropertyName)

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

false

-Target<WBBackupTarget>

Specifies a backup target object that specifies the backup storage location to remove from the WBPolicy object.


エイリアス

なし

必須?

true

位置は?

2

既定値

なし

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

True (ByPropertyName)

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

false

<CommonParameters>

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

入力

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

  • WBBackupTarget, WBPolicy

    The Remove-WBBackupTarget cmdlet removes a WBBackupTarget object from a WBPolicy object that contains the backup policy.


出力

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

  • WBBackupTarget[]

    The Remove-WBBackupTarget cmdlet displays a list of WBBackupTarget objects left in the policy.


Example 1: Remove a backup target from a backup policy

This example removes a WBBackupTarget object from a WBPolicy object and then displays a list of backup locations left in the policy.

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

The second command gets the backup target locations and stores them in the variable named $BackupLocations. It also stores the backup policy in the variable named $Policy.

The third command removes the backup target in the first element of the $BackupLocations array from the policy stored in the $Policy variable.


PS C:\> $Policy = Get-WBPolicy
PS C:\> $BackupLocations = Get-WBBackupTarget -Policy $Policy
PS C:\> Remove-WBBackupTarget -Policy $Policy -Target $BackupLocations[0]

関連トピック

コミュニティの追加

追加
表示: