Get-AzureRmBackupProtectionPolicy
Gets backup policies for a Backup vault.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Get-AzureRmBackupProtectionPolicy
[[-Name] <String>]
[-Vault] <AzureRMBackupVault>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzureRmBackupProtectionPolicy cmdlet gets backup policies for an Azure Backup vault.
Examples
Example 1: View the policies in a vault
PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> Get-AzureRmBackupProtectionPolicy -Vault $Vault
Name Type ScheduleType BackupTime
---- ---- ------------ ----------
contoso01 AzureVM Daily 26-Aug-15 3:00:00 PM
DailyBkp AzureVM Daily 26-Aug-15 3:00:00 PM
DefaultPolicy AzureVM Daily 26-Aug-15 12:30:00 AM
WeeklyBkp AzureVM Weekly 26-Aug-15 5:00:00 PM
contoso02 AzureVM Daily 26-Aug-15 3:00:00 PM
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 gets all the Backup protection policies for the vault in $Vault.
Example 2: Get a specific policy from a vault
PS C:\>$Vault = Get-AzureRmBackupVault -Name "Vault03"
PS C:\> Get-AzureRmBackupProtectionPolicy -Vault $Vault -Name "DefaultPolicy"
Name Type ScheduleType BackupTime
---- ---- ------------ ----------
DefaultPolicy AzureVM Daily 26-Aug-15 12:30:00 AM
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 gets the Backup protection policy named DefaultPolicy for the vault in $Vault.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
Specifies the name of the policy that this cmdlet gets.
Type: | String |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Vault
Specifies the Backup vault for which this cmdlet gets policies. To obtain an AzureRmBackupVault object, use the Get-AzureRmBackupVault cmdlet.
Type: | AzureRMBackupVault |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Parameters: Vault (ByValue)