Remove-​Azure​Rm​Backup​Protection​Policy

Deletes a policy from a Backup vault.

Syntax

Remove-AzureRmBackupProtectionPolicy
      [-ProtectionPolicy] <AzureRMBackupProtectionPolicy>
      [-Force]
      [-Confirm]
      [-WhatIf]
      [<CommonParameters>]

Description

The Remove-AzureRmBackupProtectionPolicy cmdlet deletes a policy from an Azure Backup vault.

Before you can delete a backup protection policy, the policy must not have any associated Backup items. Before you delete the policy, make sure that each associated item is associated with some other policy. To associate another policy with a backup item, use the Enable-AzureRmBackupProtection cmdlet.

Examples

Example 1: Remove a backup protection policy

PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> Get-AzureRmBackupProtectionPolicy -Vault $Vault -Name "DailyBackup" | Remove-AzureRmBackupProtectionPolicy

The first command gets the vault named Vault03 by using the Get-AzureRmBackupVault cmdlet. The command stores that object in the $Vault variable.

The second command creates a retention policy for 30 days of daily retention, and then stores it in the $Daily variable.

The second command gets the protection policy named DailyBackup in the vault in $Vault by using the Get-AzureRmBackupProtectionPolicy cmdlet. The command passes the policy to the current cmdlet. That cmdlet removes the policy.

Required Parameters

-ProtectionPolicy

Specifies protection policy that this cmdlet removes. To obtain an AzureRmBackupProtectionPolicy, use the Get-AzureRmBackupProtectionPolicy cmdlet

Type:AzureRMBackupProtectionPolicy
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureRMBackupProtectionPolicy

Outputs

None