< Back

Remove-AzureRmRecoveryServicesBackupProtectionPolicy

Tue Jan 29, 2019 10:00 pm

NAME Remove-AzureRmRecoveryServicesBackupProtectionPolicy



SYNOPSIS

Deletes a Backup protection policy from a vault.





SYNTAX

Remove-AzureRmRecoveryServicesBackupProtectionPolicy [-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-Force] [-PassThru] [-Confirm]

[-WhatIf] [<CommonParameters>]



Remove-AzureRmRecoveryServicesBackupProtectionPolicy [-Policy] <PolicyBase> [-DefaultProfile <IAzureContextContainer>] [-Force] [-PassThru]

[-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Remove-AzureRmRecoveryServicesBackupProtectionPolicy cmdlet deletes backup policies for a 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-AzureRmRecoveryServicesBackupProtection cmdlet.



Set the vault context by using the Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Forces the command to run without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies the name of the Backup protection policy to remove.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Return the policy to be deleted.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Policy <PolicyBase>

Specifies the Backup protection policy to remove. To obtain an BackupPolicy object, use the Get-AzureRmRecoveryServicesBackupProtectionPolicy

cmdlet.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PolicyBase

Parameter 'Policy' accepts value of type 'PolicyBase' from the pipeline





OUTPUTS



NOTES









Example 1: Remove a policy



PS C:\\>$Pol= Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name "NewPolicy"

PS C:\\> Remove-AzureRmRecoveryServicesBackupProtectionPolicy -Policy $Pol



The first command gets the Backup protection policy named NewPolicy, and then stores it in the $Pol variable.



The second command removes the policy object in $Pol.







RELATED LINKS

Online Version:

https://docs.microsoft.com/en-us/powers ... tionpolicy

Get-AzureRmRecoveryServicesBackupProtectionPolicy

New-AzureRmRecoveryServicesBackupProtectionPolicy

Set-AzureRmRecoveryServicesBackupProtectionPolicy