Remove-WssBackupTarget

Removes a backup target from a scheduled backup policy.

Syntax

Remove-WssBackupTarget
      [-BackupPolicy] <ScheduledBackupPolicy>
      [-BackupTarget] <BackupTarget>
      [<CommonParameters>]

Description

The Remove-WssBackupTarget cmdlet removes a backup target from a scheduled backup policy. A scheduled backup policy is a backup file specification that has a backup schedule associated with it. If you remove a backup target from a scheduled backup policy, backups that use the policy no longer back up the files and volumes that the target specifies.

Examples

Example 1: Remove a backup target from a policy

PS C:\>$ContosoBUPolicies10 = Get-WSSBackupPolicy
PS C:\> $ContosoBUTarget = Get-WssBackupTarget -BackupPolicy $ContosoBUPolicies10[9]
PS C:\> Remove-WssBackupTarget -BackupPolicy $ContosoBUPolicy10[9] -BackupTarget $ContosoBUTarget

This example removes a backup target from a backup policy.

The first command gets the current backup policies and stores them in the $ContosoBUPolicies10 variable.

The second command gets the backup target for the tenth policy in the $ContosoBUPolicies10 array, and then stores the backup target in the $ContosoBUTarget variable.

The third command removes the backup target that is stored in $ContosoBUTarget from the policy stored in $ContosoBUPolicies10[9].

Parameters

-BackupPolicy

Specifies the scheduled backup policy from which to remove the backup target.

Type:ScheduledBackupPolicy
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-BackupTarget

Specifies the name of the backup target to remove.

Type:BackupTarget
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Microsoft.WindowsServerSolutions.DataProtection.ServerBackup.ObjectModel.BackupTarget

This cmdlet generates backup targets.