PowerShell script exchange
Post Reply
frankU32
Enthusiast
Posts: 36
Liked: 2 times
Joined: May 02, 2018 11:56 am
Full Name: Frank Tighe
Contact:

Set the amount of restore points

Post by frankU32 »

I am struggling to find which command I use to set the number of restore points in a job. Can someone please point me in the right place.

Thanks

Frank
anthonyspiteri79
Veeam Software
Posts: 742
Liked: 209 times
Joined: Jan 14, 2016 6:48 am
Full Name: Anthony Spiteri
Location: Perth, Australia
Contact:

Re: Set the amount of restore points

Post by anthonyspiteri79 »

Hey Frank...something like this should work:

Code: Select all

$jobname="J1"
$RestorePointValue="7"
$JobOptions = Get-VBRJobOptions $jobname
$JobOptions.BackupStorageOptions.RetainCycles = $RestorePointsValue 
$Jobname | Set-VBRJobOptions -Options $JobOptions
Anthony Spiteri
Regional CTO APJ & Lead Cloud and Service Provider Technologist
Email: anthony.spiteri@veeam.com
Twitter: @anthonyspiteri
frankU32
Enthusiast
Posts: 36
Liked: 2 times
Joined: May 02, 2018 11:56 am
Full Name: Frank Tighe
Contact:

Re: Set the amount of restore points

Post by frankU32 »

Awesome, thank you
frankU32
Enthusiast
Posts: 36
Liked: 2 times
Joined: May 02, 2018 11:56 am
Full Name: Frank Tighe
Contact:

Re: Set the amount of restore points

Post by frankU32 » 1 person likes this post

The example you gave was close but not 100%, and it got me there. This is what i did that works.

Code: Select all

$RestorePoints = 21

$Joboptions = get-vbrjob -Name JobName  | Get-VBRJobOptions 
$JobOptions.BackupStorageOptions.RetainCycles = $RestorePoints
get-vbrjob -Name JobName | Set-VBRJobOptions -Options $JobOptions
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests