Find Azure backup/retention associated with backup policy

前端 未结 1 1904
天命终不由人
天命终不由人 2021-01-22 05:05

I can get backup policy name via : How to find Azure VM applied backup protection policy name via Powershell BUT looking to find actual configuration associated with backuppolic

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-22 05:36

    You could use Get-AzureRmRecoveryServicesBackupProtectionPolicy|fl to get them.

    For example:

    ##Replace Recovery service vault name
    Get-AzureRmRecoveryServicesVault -Name "shui" | Set-AzureRmRecoveryServicesVaultContext
    
    ##FriendlyName is your Azure VM name
    $namedContainer=Get-AzureRmRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -FriendlyName "shui"
    $item = Get-AzureRmRecoveryServicesBackupItem -Container $namedContainer -WorkloadType "AzureVM"
    
    $policyname=$item.ProtectionPolicyName
    $policy=Get-AzureRmRecoveryServicesBackupProtectionPolicy -Name $policyname
    
    ##BACKUP FREQUENCY
    $policy.SchedulePolicy
    ##RETENTION RANGE
    $policy.RetentionPolicy
    

    0 讨论(0)
提交回复
热议问题