PowerShell script exchange
jevao
Enthusiast
Posts: 29 Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:
Post
by jevao » Jun 06, 2014 4:04 pm
this post
Hello,
I was able to change the "RetryTimes" on a backup job using the commands:
Code: Select all
$Job = Get-VBRJob | ?{$_.name -eq "JobName"}
$job.scheduleoptions.retrytimes = 0
But going into the Veeam Backup and Replication GUI --> Job --> "Edit --> Schedule --> Automatic Retry --> Retry Failed VMs Processing = 3
Still says RetryTimes = 3
How do you get the Veeam Backup and REplicaiton GUI to reflect the change?
Thanks
tsightler
VP, Product Management
Posts: 6035 Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:
Post
by tsightler » Jun 07, 2014 12:39 am
this post
Once you change the variable you have to actually update the job with the new options:
Code: Select all
$Job = Get-VBRJob -Name "JobName"
$Job.ScheduleOptions.RetryTimes = 0
Set-VBRJobScheduleOptions -Job $Job -Options $Job.ScheduleOptions
However, I don't believe this will actually disable retries on the job as you cannot set retries to "0" even via the GUI the lowest value you can set is "1". If you want to disable retries completely you need to use code something like the following:
Code: Select all
$Job = Get-VBRJob -Name "JobName"
$Job.ScheduleOptions.RetrySpecified = $false
Set-VBRJobScheduleOptions -Job $Job -Options $Job.ScheduleOptions
This is the equivalent to unchecking the retry option in the GUI.
jevao
Enthusiast
Posts: 29 Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:
Post
by jevao » Jun 11, 2014 1:49 am
this post
Hello,
I used your code to successfully try both. I set retries to '1' and then decided to turn off retries altogether. Very helpful. Thanks
baltechnique
Novice
Posts: 8 Liked: 1 time
Joined: Sep 30, 2013 7:11 am
Full Name: Network Consulting
Contact:
Post
by baltechnique » Jun 17, 2014 7:20 am
1 person likes this post
Hi,
it would be cool if in next Veeam Version you put a box at the end of wizards, like Microsoft do most of time, putting the powershell equivalent code of the action done.
veremin
Product Manager
Posts: 20406 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jun 17, 2014 8:22 am
this post
You mean the box containing equivalent for every occurred action or just the command that can be used to run given job, for example? We already provide a command line equivalent using which one can execute a job (Summary page -> commandline). Thanks.
baltechnique
Novice
Posts: 8 Liked: 1 time
Joined: Sep 30, 2013 7:11 am
Full Name: Network Consulting
Contact:
Post
by baltechnique » Jun 17, 2014 9:22 am
this post
thx.
veremin
Product Manager
Posts: 20406 Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jun 17, 2014 10:36 am
this post
You're welcome. Don't hesitate to contact us, should other clarification be required. Thanks.
Users browsing this forum: Bing [Bot] and 12 guests