"Run the job automatically"

PowerShell script exchange

"Run the job automatically"

Veeam Logoby Phill Rogers » Thu Nov 01, 2012 1:00 pm

Hi, I've got a script creating backup jobs with all the options I want but I cannot find how to set the flag which is in the GUI with the text " Run the job automatically".

Note that the $job.EnableScheduler() and $job.DisableScheduler() functions do the equivalent of the GUI right-clicking on a job and toggling the "Disable" tick box. This is not the same.

If I manually set the flag: Select job -> Edit -> Next -> Next -> Next -> Next -> [x] Run the job automatically -> Finish
Then the $job.DisableSheduler() function does the above *AS WELL* as clearing the flag.
But the $job.EnableScheduler() function *ONLY* does the above and does NOT set this flag.

Anyone know how to set this flag from PowerShell?
Phill Rogers
Novice
 
Posts: 3
Liked: never
Joined: Thu Nov 01, 2012 12:07 pm
Full Name: Phill Rogers

Re: "Run the job automatically"

Veeam Logoby pizzim13 » Thu Nov 01, 2012 1:53 pm

It is with the scheduling options. You can pick apart this function to use the piece you need > Function for setting backup job options
pizzim13
Enthusiast
 
Posts: 86
Liked: 6 times
Joined: Thu Apr 21, 2011 7:37 pm

Re: "Run the job automatically"

Veeam Logoby Phill Rogers » Fri Nov 02, 2012 9:03 am

I thought I posted this yesterday but must have got lost. Anyway ..

Thanks for the code. Yours worked fine so I cut it down to the absolute minimum then compared with mine line by line.
Eventually found that I was missing the ..
$vbrjoboptions.JobOptions.RunManually = $false
.. which I had in earlier versions but must have cut it somewhere in the edit. Doh!

Thanks.
Phill Rogers
Novice
 
Posts: 3
Liked: never
Joined: Thu Nov 01, 2012 12:07 pm
Full Name: Phill Rogers


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests