PowerShell script exchange
mar41004
Lurker
Posts: 2 Liked: never
Joined: Jun 15, 2021 8:51 am
Full Name: Markeus Woodworth
Contact:
Post
by mar41004 » Jun 15, 2021 9:26 am
this post
Hi,
I am trying to script a VM Copy Job through powershell. I have manged to change some of the settings using the script below:
Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Backup Copy Job Name"
$Options = $Job.GetOptions()
$Options.generationPolicy.SimpleRetentionRestorePoints = "5"
$Options.generationPolicy.GFSWeeklyBackups = "0"
$Options.generationPolicy.GFSMonthlyBackups = "6"
$Options.generationPolicy.GFSMonthlyBackupsEnabled = "True"
$Options.generationPolicy.WeeklyBackupDayOfWeek = "Friday"
Set-VBRJobOptions -Job $Job -Options $Options
Is there any way to enable "keep the following restore points as full backups for archival purposes" and also change the Schedule day for Weekly, Monthly and Yearly to be a Friday?
Thanks
oleg.feoktistov
Veeam Software
Posts: 2010 Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:
Post
by oleg.feoktistov » Jun 15, 2021 9:19 pm
this post
Hi Markeus and welcome to the R&D forums,
Do you mean settings for agent backup copy jobs or regular ones? Currently, the ways to set these options differ a lot for both.
Thanks,
Oleg
mar41004
Lurker
Posts: 2 Liked: never
Joined: Jun 15, 2021 8:51 am
Full Name: Markeus Woodworth
Contact:
Post
by mar41004 » Jun 16, 2021 9:13 am
this post
Hi Oleg,
Thanks for the reply. The copy jobs are for regular ones. We are doing a Backup Copy of a Virtual Machine to our offsite storage so no agents are being used.
Thanks
Markeus
oleg.feoktistov
Veeam Software
Posts: 2010 Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:
Post
by oleg.feoktistov » Jun 17, 2021 3:11 pm
this post
Hi Markeus,
Got it. Then you are after GFSPolicy property. It's all there:
Code: Select all
$job = Get-VBRJob -Name 'Backup Copy Job 1'
$options = $Job.GetOptions()
$GFS = $options.GFSPolicy
$GFS.IsEnabled = $true
$GFS.Weekly.IsEnabled = $true
$GFS.Weekly.DesiredTime = 'Friday'
$GFS.Weekly.KeepBackupsForNumberOfWeeks = 2
Set-VBRJobOptions -Job $job -Options $options
I'm not sure though what you mean by changing a schedule day to Friday for Monthly and Yearly backups. The day option is available only for Weekly ones.
Thanks,
Oleg
Users browsing this forum: No registered users and 9 guests