Get-AzureRmRecoveryServicesBackupProtectionPolicy

Gets Backup protection policies for a 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-AzureRmRecoveryServicesBackupProtectionPolicy
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRecoveryServicesBackupProtectionPolicy
   [-Name] <String>
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRecoveryServicesBackupProtectionPolicy
   [-WorkloadType] <WorkloadType>
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzureRmRecoveryServicesBackupProtectionPolicy
   [-WorkloadType] <WorkloadType>
   [-BackupManagementType] <BackupManagementType>
   [-VaultId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzureRmRecoveryServicesBackupProtectionPolicy cmdlet gets Azure Backup protection policies for a vault. Set the vault context by using the Set-AzureRmRecoveryServicesVaultContext cmdlet before you use the current cmdlet.

Examples

Example 1: Get all policies in the vault

PS C:\> Get-AzureRmRecoveryServicesBackupProtectionPolicy 
Name                 WorkloadType       BackupManagementType BackupTime                DaysOfWeek   
----                 ------------       -------------------- ----------                ----------   
DefaultPolicy        AzureVM            AzureVM              4/14/2016 5:00:00 PM                   
NewPolicy            AzureVM            AzureVM              4/23/2016 5:30:00 PM                   
NewPolicy2           AzureVM            AzureVM              4/24/2016 1:30:00 AM

This command gets all protection policies created in the vault.

Example 2: Get a specific policy

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

This command gets the protection policy named DefaultPolicy, and then stores it in the $Pol variable.

Parameters

-BackupManagementType

Specifies the Backup management type. Currently, only AzureVM, AzureStorage is supported.

Type:Nullable<T>[BackupManagementType]
Accepted values:AzureVM, MARS, SCDPM, AzureBackupServer, AzureSQL, AzureStorage
Position:3
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-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.

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

-VaultId

ARM ID of the Recovery Services Vault.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WorkloadType

Specifies the workload type. Currently, only AzureVM, AzureFiles is supported.

Type:Nullable<T>[WorkloadType]
Accepted values:AzureVM, AzureSQLDatabase, AzureFiles
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Parameters: VaultId (ByValue)

Outputs

PolicyBase