Edit

Share via


Get-AzRecoveryServicesBackupProtectionPolicy

Gets Backup protection policies for a vault.

Syntax

NoParamSet (Default)

Get-AzRecoveryServicesBackupProtectionPolicy
    [-IsArchiveSmartTieringEnabled <Boolean>]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-PolicySubType <PSPolicyType>]
    [<CommonParameters>]

PolicyNameParamSet

Get-AzRecoveryServicesBackupProtectionPolicy
    [-Name] <String>
    [-IsArchiveSmartTieringEnabled <Boolean>]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-PolicySubType <PSPolicyType>]
    [<CommonParameters>]

WorkloadParamSet

Get-AzRecoveryServicesBackupProtectionPolicy
    [-WorkloadType] <WorkloadType>
    [-IsArchiveSmartTieringEnabled <Boolean>]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-PolicySubType <PSPolicyType>]
    [<CommonParameters>]

WorkloadBackupManagementTypeParamSet

Get-AzRecoveryServicesBackupProtectionPolicy
    [-WorkloadType] <WorkloadType>
    [-BackupManagementType] <BackupManagementType>
    [-IsArchiveSmartTieringEnabled <Boolean>]
    [-VaultId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-PolicySubType <PSPolicyType>]
    [<CommonParameters>]

Description

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

Examples

Example 1: Get all policies in the vault

Get-AzRecoveryServicesBackupProtectionPolicy
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

$Pol= Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"

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

Example 3: Get only Enhanced policies in a vault

$pol = Get-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -BackupManagementType AzureVM -WorkloadType AzureVM  -PolicySubType Enhanced

This command gets only the Enhanced protection policies in RS vault, and then stores it in the $pol variable.

Example 4: Get smart tiering enabled policies in a vault

$pol = Get-AzRecoveryServicesBackupProtectionPolicy -VaultId $vault.ID -BackupManagementType AzureVM -WorkloadType AzureVM  -IsArchiveSmartTieringEnabled $true

This command gets only the policies in RS vault for which archive smart tiering is enabled. To fetch the policies for which smart tiering is disabled, set IsArchiveSmartTieringEnabled parameter to $false. To fetch all the policies, skip this parameter.

Parameters

-BackupManagementType

The class of resources being protected. Currently the values supported for this cmdlet are AzureVM, AzureStorage, AzureWorkload

Parameter properties

Type:

Nullable<T>[BackupManagementType]

Default value:None
Accepted values:AzureVM, SCDPM, AzureBackupServer, AzureStorage, AzureWorkload, MAB
Supports wildcards:False
DontShow:False

Parameter sets

WorkloadBackupManagementTypeParamSet
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsArchiveSmartTieringEnabled

Parameter to list policies for which smart tiering is Enabled/Disabled. Allowed values are $true, $false.

Parameter properties

Type:

Nullable<T>[Boolean]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the policy.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PolicyNameParamSet
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PolicySubType

Type of policy to be fetched: Standard, Enhanced

Parameter properties

Type:PSPolicyType
Default value:None
Accepted values:Standard, Enhanced
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VaultId

ARM ID of the Recovery Services Vault.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkloadType

Workload type of the resource. The current supported values are AzureVM, AzureFiles, MSSQL

Parameter properties

Type:

Nullable<T>[WorkloadType]

Default value:None
Accepted values:AzureVM, AzureSQLDatabase, AzureFiles, MSSQL
Supports wildcards:False
DontShow:False

Parameter sets

WorkloadParamSet
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
WorkloadBackupManagementTypeParamSet
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

PolicyBase