PowerShell script exchange
Post Reply
jevao
Enthusiast
Posts: 29
Liked: 3 times
Joined: Oct 28, 2011 11:38 pm
Full Name: James Collison
Contact:

Powershell and the GUI

Post by jevao »

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: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Powershell and the GUI

Post by tsightler »

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:

Re: Powershell and the GUI

Post by jevao »

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:

Re: Powershell and the GUI

Post by baltechnique » 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: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell and the GUI

Post by veremin »

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:

Re: Powershell and the GUI

Post by baltechnique »

thx.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell and the GUI

Post by veremin »

You're welcome. Don't hesitate to contact us, should other clarification be required. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests