PowerShell script exchange
efd121
Enthusiast
Posts: 67 Liked: 6 times
Joined: Aug 07, 2015 8:45 pm
Full Name: David Engler
Contact:
Post
by efd121 » Dec 22, 2015 8:47 pm
this post
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: 67 Liked: 6 times
Joined: Aug 07, 2015 8:45 pm
Full Name: David Engler
Contact:
Post
by efd121 » Dec 22, 2015 11:07 pm
1 person likes this post
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
veremin
Product Manager
Posts: 20400 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Dec 23, 2015 12:02 pm
this post
Can anyone confirm my results?
Correct. The retention setting of backup copy job are present in GenerationPolicy parameters' group. Thanks.
Users browsing this forum: No registered users and 16 guests