Set-VBRJobOptoins updating RetainCycles

PowerShell script exchange

Set-VBRJobOptoins updating RetainCycles

Veeam Logoby efd121 » Tue Dec 22, 2015 8:47 pm

I'm attempting to set the number of retentions on a Backup Copy job to the same value as the Backup job but I'm having dificulty with the Set-VBRJobOptions
The section of code below runs without any errors but the # of restore points is not updated from the default of 7
I added the Write-Host line to confirm it should be changing the value to 14.

Any suggestions on what I'm doing wrong?

Code: Select all
# Find # of restore points in Backup Job then update BCJob with same # retentions
$tmpJob = Get-VBRJob -Name "TestJob1"
$RestorePoints = $tmpJob.Options.BackupStorageOptions.RetainCycles
$JobOptions = "BCTestJob1" | Get-VBRJobOptions
$JobOptions.BackupStorageOptions.RetainCycles = $RestorePoints
Write-Host "JobOptions=" $JobOptions.BackupStorageOptions.RetainCycles -ForegroundColor Yellow
Set-VBRJobOptions -Job "BCTestJob1" -Options $JobOptions
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler

Re: Set-VBRJobOptoins updating RetainCycles

Veeam Logoby efd121 » Tue Dec 22, 2015 11:07 pm

I have been doing some more research on this and I think I have found why it appears my script was not running.

It appears that Options.BackupStorageOptions.RetainCycles is the value used for the number of restore points for Backup Jobs

And GenerationPolicy.SimpleRetentionRestorePoints is used for Backup Copy Jobs

Can anyone confirm my results?

Dave
efd121
Enthusiast
 
Posts: 25
Liked: never
Joined: Fri Aug 07, 2015 8:45 pm
Full Name: David Engler

Re: Set-VBRJobOptoins updating RetainCycles

Veeam Logoby v.Eremin » Wed Dec 23, 2015 12:02 pm

Can anyone confirm my results?

Correct. The retention setting of backup copy job are present in GenerationPolicy parameters' group. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests