how to change number of restore points

PowerShell script exchange

how to change number of restore points

Veeam Logoby SmithJohn » Mon Jan 27, 2014 8:04 am

how to change number of restore points to be kept for a new job or an existing job through powershell ?
SmithJohn
Enthusiast
 
Posts: 47
Liked: never
Joined: Thu Jan 31, 2013 3:36 am
Full Name: charles

Re: how to change number of restore points

Veeam Logoby v.Eremin » Mon Jan 27, 2014 8:29 am

Hi, Charles, it can be done via Get/SetOptions method.

For instance, the following example will set 18 as a number of restore points the backup job keeps:

Code: Select all
$Job = Get-VBRJob -name "Name of backup job"
$Options = $Job.GetOptions()
$Options.BackupStorageOptions.RetainCycles = 18
$Job.SetOptions($Options)


Thanks.
v.Eremin
Veeam Software
 
Posts: 13295
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: how to change number of restore points

Veeam Logoby LarsWulf » Thu Feb 20, 2014 2:21 pm 1 person likes this post

Hi everybody,

I was facing a similar problem. I needed to change the amount of restore points for all my 42 jobs. So I found the code from Vladimir and extended it with a Prompt for the amount of Restore Points and a loop for all jobs. Maybe this helps somebody else who needs to change the restore points for all his jobs.

Code: Select all
# Set desired Amount of Restore Points
param ([parameter(Mandatory=$true)][string]$RestorePoints)
#
$Jobs = Get-VBRJob
ForEach ($Job in $Jobs)
{
   $Options = $Job.GetOptions()
   $Options.BackupStorageOptions.RetainCycles = $RestorePoints
   $Job.SetOptions($Options)
}


Regards
Lars
LarsWulf
Enthusiast
 
Posts: 36
Liked: 7 times
Joined: Mon Nov 28, 2011 9:05 pm
Full Name: Lars Wulf

[MERGED] Set Retention Policy

Veeam Logoby emmoon1981 » Sat Jul 09, 2016 10:53 am

I was wondering if there is a powershell CMDlet to set the number of "Restore point to keep on disk" for specific job/all jobs.
Thanks
emmoon1981
Novice
 
Posts: 5
Liked: never
Joined: Sat Jul 09, 2016 9:34 am
Full Name: Ehsan Mohseni

Re: Set Retention Policy

Veeam Logoby Vitaliy S. » Sat Jul 09, 2016 7:16 pm

Try to use the script example provided above.
Vitaliy S.
Veeam Software
 
Posts: 19572
Liked: 1104 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests