PowerShell script exchange
Post Reply
dieterbocklandt
Novice
Posts: 5
Liked: 2 times
Joined: Feb 05, 2015 10:53 am
Full Name: Dieter Bocklandt
Contact:

Cant get schedule of backup that runs after another backup

Post by dieterbocklandt »

Hi,

I'm working on a script that gives me all schedules of all our backup jobs. That works fine for now, only backup jobs that are scheduled to run after another job pose a problem. I cant seem to get the "parent" job out of the Powershell API. The only thing I've found is the OptionsScheduleAfterJob property, but that only contains a boolean.

Is there anyway I can get this information?

Thanks!
Dieter
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Cant get schedule of backup that runs after another back

Post by PTide »

Hi,

I think that this is what you need:

Code: Select all

PS C:\Users\PTide> $job1 = Get-VBRJob -Name "Backup Job 3"
PS C:\Users\PTide> $job1.PreviousJobIdInScheduleChain

Guid
----
76beb3a2-8574-439a-936d-aba98c6fb957
Using the output of the last command you can get the previous job's properties.
dieterbocklandt
Novice
Posts: 5
Liked: 2 times
Joined: Feb 05, 2015 10:53 am
Full Name: Dieter Bocklandt
Contact:

Re: Cant get schedule of backup that runs after another back

Post by dieterbocklandt » 1 person likes this post

Exactly the thing I was looking for! Thanks a lot for for the fast answer!

When I finally finish the script, I'll share it with the rest of the community.

Thanks,
Dieter
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests