I try to get retention policy from all jobs.
I use this command:
Code: Select all
Get-VBRJob | ? {$_.jobtype -eq "Backup"} | Select-Object -Property @{N="Job Name"; E={$_.name}}, @{N = "Storage Retention"; E={$_.GetOptions().BackupStorageOptions.Retaincycles}} | Format-Table -AutoSize
Code: Select all
Job Name Storage Retention
-------- -----------------
bck-recette 31
bck-aaa-nouvelles-vm 31
bck-cobalt-adresa 31
bck-blue-aboweb 31
bck-cobalt-bdd 31
bck-blue-aboshop-routage 31
bck-cobalt-hayo 31
bck-qiota 31
bck-blue-tbsreport 31
bck-infra-interne 31
bck-dijonne 7
bck-infra-client 31
bck-preprod 31
bck-it-infra 7
bck-cobalt-alohav6-lefac 31
bck-dev 31
bck-cobalt-tbsreport 31
bck-comcom 31
bck-blue-dialog 31
bck-blue-bdd 31If I check on Veeam Backup & replication console, job name bck-aaa-nouvelles-vm is configured with retention policy for 15 days, not 31 .
If I change Retaincycles by RetainDays, results is wrong too :
Code: Select all
Get-VBRJob | ? {$_.jobtype -eq "Backup"} | Select-Object -Property @{N="Job Name"; E={$_.name}}, @{N = "Storage Retention"; E={$_.GetOptions().BackupStorageOptions.Retaindays}} | Format-Table -AutoSizeCode: Select all
Job Name Storage Retention
-------- -----------------
bck-recette 32
bck-aaa-nouvelles-vm 32
bck-cobalt-adresa 32
bck-blue-aboweb 32
bck-cobalt-bdd 32
bck-blue-aboshop-routage 32
bck-cobalt-hayo 32
bck-qiota 32
bck-blue-tbsreport 32
bck-infra-interne 32
bck-dijonne 14
bck-infra-client 32
bck-preprod 32
bck-it-infra 32
bck-cobalt-alohav6-lefac 32
bck-dev 32
bck-cobalt-tbsreport 32
bck-comcom 32
bck-blue-dialog 32
bck-blue-bdd 32Regards