PowerShell script exchange
Post Reply
mark_firestone
Novice
Posts: 5
Liked: never
Joined: Jan 19, 2011 11:17 am
Full Name: Mark Firestone
Contact:

Disabled

Post by mark_firestone »

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

Alexey D.

Re: Disabled

Post by Alexey D. »

Hello Mark,

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

sjutras
Service Provider
Posts: 19
Liked: never
Joined: Oct 14, 2009 4:23 am
Contact:

Re: Disabled

Post by sjutras »

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

Alexey D.

Re: Disabled

Post by Alexey D. »

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests