Author Posts

July 22, 2018 at 8:02 am

Need help on changing retention period of each backup policy in Recovery services vault .We have multiple vaults and many policies in each vault .Hence wanted to script the process.

Below is the script i used to get all policies in all vaults .But not able to change the retention period of each policy

foreach($recoveryServicesVault in $recoveryServicesVaults)
Set-AzureRmRecoveryServicesVaultContext -Vault $recoveryServicesVault
$backupPolicies=Get-AzureRmRecoveryServicesBackupProtectionPolicy -WarningAction Ignore
foreach($backupPolicy in $backupPolicies)
$Info = New-Object PSObject -Property @{

$backupPolicyArray += $Info