问题
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 backuppolicy like following data :
BACKUP FREQUENCY
Daily at 00:00 RETENTION RANGE
Retention of daily backup point
Retain backup taken every day at 00:00 for 7 Day(s) Retention of weekly backup point
Retain backup taken every week on Saturday at 00:00 for 4 Week(s) Retention of monthly backup point
Retain backup taken every month on First Saturday at 00:00 for 12 Month(s) Retention of yearly backup point
Retain backup taken every year in January on First Saturday at 00:00 for 99 Year(s)
回答1:
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
来源:https://stackoverflow.com/questions/47537916/find-azure-backup-retention-associated-with-backup-policy