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 » Jun 06, 2014 4:04 pm

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

Re: Powershell and the GUI

Post by tsightler » Jun 07, 2014 12:39 am

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 » Jun 11, 2014 1:49 am

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 » 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: 16789
Liked: 1408 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell and the GUI

Post by veremin » Jun 17, 2014 8:22 am

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 » Jun 17, 2014 9:22 am

thx.

veremin
Product Manager
Posts: 16789
Liked: 1408 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell and the GUI

Post by veremin » Jun 17, 2014 10:36 am

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 4 guests