PowerShell script exchange
Post Reply
cmgray1
Lurker
Posts: 1
Liked: never
Joined: Sep 03, 2015 9:35 pm
Full Name: Charles M. Gray
Contact:

Code to enable/disable Backup Jobs

Post by cmgray1 »

Hi Guys,
I am looking a creating an automated way to disable several backup job services and enable several backup services. The task needs to be run once a quarter. Currently have Veeam backup 6.5 possible moving to V8. Any suggestions on how to do this.
NOTE: I am PowerShell / batch file coding experience limited.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Code to enable/disable Backup Jobs

Post by veremin »

Hi, Charles,

You can use the following example to achieve what you're after:

Code: Select all

#Enable
asnp VeeamPSSnapin
$JobNames = "Name of first job", "Name of second job", etc.
Foreach ($Job in (Get-VBRJob -name $JobNames))
{Enable-VBRJob -Job $Job}

Code: Select all

#Disable
asnp VeeamPSSnapin
$JobNames = "Name of first job", "Name of second job", etc.
Foreach ($Job in (Get-VBRJob -name $JobNames))
{Enable-VBRJob -Job $Job}
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests