Disabled

PowerShell script exchange

Disabled

Veeam Logoby mark_firestone » Wed Jan 19, 2011 11:26 am

Hi guys.

I have been writing a powershell script to stop backups in case of a failure of power to a server (if the server goes down in the middle of a backup it sometimes corrupts a job). This way, if the UPS powerfail triggers, it should smoothly clean itself up.

Stopping the backups is easy, but what I want to do next is disable the backup job until we intervene and turn it back on.

I can't for the life of me find a property in any object that lets me toggle the "disable job" setting on the job property sheet.

Is this possible? and if so, which property should I set to false?

Thanks,

mark
mark_firestone
Novice
 
Posts: 5
Liked: never
Joined: Wed Jan 19, 2011 11:17 am
Full Name: Mark Firestone

Re: Disabled

Veeam Logoby Alexey D. » Wed Jan 19, 2011 1:08 pm

Hello Mark,

Let me consult with our powershell guru, and I will post back the answer.
Alexey D.
 

Re: Disabled

Veeam Logoby sjutras » Wed Jan 19, 2011 3:46 pm

I would also be interested in knowing this.

edit: that or the possibility to change the targetdir in a backup job (using powershell of course)

Thanks
sjutras
Influencer
 
Posts: 19
Liked: never
Joined: Wed Oct 14, 2009 4:23 am

Re: Disabled

Veeam Logoby Alexey D. » Thu Jan 20, 2011 2:27 pm

To disable a job:

Code: Select all
#first get the job object
$bjname = "bj1*"
$oldJob = Get-VBRJob | ? {$_.Name -like $bjname}

#to disable or enable job scheduler just call appropriate method of the job object
$oldJob.DisableScheduler()

$oldJob.EnableScheduler()

#to get the current state of scheduler options use the following method. It return BOOLEAN
$oldJob.get_IsScheduleEnabled()

About changing backup target folder with PowerShell - this is not implemented in the product right now.
Alexey D.
 


Return to PowerShell



Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests