简体   繁体   中英

Find Azure backup/retention associated with backup policy

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)

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM