PowerShell script exchange
Post Reply
reygers
Novice
Posts: 5
Liked: never
Joined: Nov 24, 2010 9:07 am
Contact:

PowerShell automation for tape jobs: how to detect job enabled/disabled and success/failure status?

Post by reygers »

I cannot find a way to query the enabled/disabled status of a tape job via PowerShell.

Neither .IsScheduleEnabled nor .CanRunByScheduler() seem to be available.

Is this not supported? Maybe there is an "indirect" way to retrieve this information for tape jobs?

Also, the success/failure status doesn't seem to be available inside post-job scripts - the returned tape job status is apparently still in state "working".
I'd like the post-job script to determine whether tapes should be exported at the end of a successful (monthly) tape run, as a convenience for the tape operators.

Is there an alternative way to retrieve success/failure status inside a PowerShell script that runs as a post-job script of a tape job?

Thanks.
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PowerShell automation for tape jobs: how to detect job enabled/disabled and success/failure status?

Post by veremin »

Have you tried to query:

- NextRun parameter (disabled jobs must have some common date there; like 1900 or something)
- LastResult parameter; should have information regarding the latest job result

More information about the mentioned parameters can be found here.

Thanks.
reygers
Novice
Posts: 5
Liked: never
Joined: Nov 24, 2010 9:07 am
Contact:

Re: PowerShell automation for tape jobs: how to detect job enabled/disabled and success/failure status?

Post by reygers »

Unfortunately, LastResult is still "None" during post-job execution, and "NextRun" is empty (probably because the tape job is executed as part of a job chain).
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 16 guests