Powershell and the GUI

PowerShell script exchange

Powershell and the GUI

Veeam Logoby jevao » Fri 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
jevao
Enthusiast
 
Posts: 29
Liked: 3 times
Joined: Fri Oct 28, 2011 11:38 pm
Full Name: James Collison

Re: Powershell and the GUI

Veeam Logoby tsightler » Sat 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.
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Powershell and the GUI

Veeam Logoby jevao » Wed 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
jevao
Enthusiast
 
Posts: 29
Liked: 3 times
Joined: Fri Oct 28, 2011 11:38 pm
Full Name: James Collison

Re: Powershell and the GUI

Veeam Logoby baltechnique » Tue 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.
baltechnique
Novice
 
Posts: 8
Liked: 1 time
Joined: Mon Sep 30, 2013 7:11 am
Full Name: Network Consulting

Re: Powershell and the GUI

Veeam Logoby v.Eremin » Tue 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.
v.Eremin
Veeam Software
 
Posts: 13257
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Powershell and the GUI

Veeam Logoby baltechnique » Tue Jun 17, 2014 9:22 am

thx.
baltechnique
Novice
 
Posts: 8
Liked: 1 time
Joined: Mon Sep 30, 2013 7:11 am
Full Name: Network Consulting

Re: Powershell and the GUI

Veeam Logoby v.Eremin » Tue Jun 17, 2014 10:36 am

You're welcome. Don't hesitate to contact us, should other clarification be required. Thanks.
v.Eremin
Veeam Software
 
Posts: 13257
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests