Code to enable/disable Backup Jobs

PowerShell script exchange

Code to enable/disable Backup Jobs

Veeam Logoby cmgray1 » Thu Sep 03, 2015 9:40 pm

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.
cmgray1
Lurker
 
Posts: 1
Liked: never
Joined: Thu Sep 03, 2015 9:35 pm
Full Name: Charles M. Gray

Re: Code to enable/disable Backup Jobs

Veeam Logoby v.Eremin » Fri Sep 04, 2015 10:50 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
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 3 guests