PowerShell script exchange
Post Reply
brupnick
Expert
Posts: 196
Liked: 13 times
Joined: Feb 05, 2011 5:09 pm
Full Name: Brian Rupnick
Location: New York, USA
Contact:

Job Stopped by User

Post by brupnick »

Good afternoon-

Is there a way via Powershell to tell that a VBR job was stopped by a user (via the GUI)? I have a script that automatically retries if the status is "Failed", but I don't want this to happen if the status is "Failed" because a user intentionally stopped a job.

Thank you!
Brian
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Job Stopped by User

Post by Gostev »

Hi Brian, I don't believe this is possible via PowerShell...
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Job Stopped by User

Post by ThomasMc »

Via the logs?

Code: Select all

PS C:\> $session = Get-VBRBackupSession | Sort CreationTime -Descending | Select -First 1
PS C:\> $log = $session.Logger.GetLog()
PS C:\> $log.UpdatedRecords

Status      : EFailed
OrdinalId   : 7
UpdateUsn   : 0
Title       : Job finished with error at 03/01/2012 20:10:00
Description :
UpdateTime  : 03/01/2012 20:10:00
Style       : ENone
Object      :
StartTime   : 03/01/2012 20:10:00
Cookie      : NoReport

Status      : EFailed
OrdinalId   : 6
UpdateUsn   : 0
Title       : Job has been terminated
Description :
UpdateTime  : 03/01/2012 20:10:00
Style       : ENone
Object      :
StartTime   : 03/01/2012 20:10:00
Cookie      :
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Job Stopped by User

Post by Gostev »

Thing is, there are also automated job terminations, and I don't believe those are distinguished from termination by user. However, if backup window enforcement is not enabled, then this might work.
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Job Stopped by User

Post by ThomasMc »

Good point Anton :)
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Job Stopped by User

Post by Gostev »

On a second thought though, presumably you should not want the job to be retried once it was terminated due to running out of the allowed backup window ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests