PowerShell script exchange
Post Reply
pchatellier
Influencer
Posts: 13
Liked: 5 times
Joined: Nov 05, 2019 4:43 pm
Contact:

Veeam v13 - BackupStorageOptions.Retaindays - Wrong informations

Post by pchatellier »

Hello,
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
I obtain those results :

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                            31
But, I have an issue, results are wrong.
If 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 -AutoSize

Code: 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                            32
Can someone help me ?
Regards
david.domask
Veeam Software
Posts: 3311
Liked: 776 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Veeam v13 - BackupStorageOptions.Retaindays - Wrong informations

Post by david.domask »

Hi pchatellier,

You're using unsupported .NET methods, we have supported means of retrieving the Job Options.

Code: Select all

$jobs = Get-VBRJob | Where-Object {$_.TypeToString -like "Vmware*"} #for VMware, you can remove the pipe to Where-Object to get all supported jobs
$jOpts = Get-VBRJobOptions -Job $jobs
$jOpts.BackupStorageOptions.RetainDaysToKeep
This will reflect the simple retention restore points, GFS is stored under the GenerationPolicy property of $jOpts.
David Domask | Product Management: Principal Analyst
pchatellier
Influencer
Posts: 13
Liked: 5 times
Joined: Nov 05, 2019 4:43 pm
Contact:

Re: Veeam v13 - BackupStorageOptions.Retaindays - Wrong informations

Post by pchatellier » 1 person likes this post

Thanks a lot, that's work.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests