PowerShell script exchange
Post Reply
Abelgdour
Novice
Posts: 5
Liked: never
Joined: Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour
Contact:

after job info through PowerShell

Post by Abelgdour »

hello,

i need a powershell script to show the jobs thats runs after a other job.

I can't figered out with get-vbrjob or get-VBRJobScheduleOptions -job "Jobname"

Does someone have any ideas

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

Re: after job info through PowerShell

Post by veremin »

You should be able to achieve what you're after, using the following script:

Code: Select all

$Job = Get-VBRJob -Name "Name of parent Job"
(Get-VBRJob) | where {$_.PreviousJobIdInScheduleChain -eq $Job.Id} | select name
Thanks.
Abelgdour
Novice
Posts: 5
Liked: never
Joined: Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour
Contact:

Re: after job info through PowerShell

Post by Abelgdour »

Hello Eremin,

Thankd for your post, but I get a emty output with your script
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: after job info through PowerShell

Post by veremin »

Are you positive that you've specified name of a job other job is linked to, not the name of linked job itself?
Abelgdour
Novice
Posts: 5
Liked: never
Joined: Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour
Contact:

Re: after job info through PowerShell

Post by Abelgdour »

Yes I'm positive
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: after job info through PowerShell

Post by veremin »

What product version you're currently at? What happens if you change the script slightly?

Code: Select all

$Job = Get-VBRJob -Name "Name of parent Job"
(Get-VBRJob) | where {$_.PreviousJobIdInScheduleChain.Guid -eq $Job.Id} | select name
You can also check whether or not PS sees at lest one linked job:

Code: Select all

(Get-VBRJob) | where {$_.PreviousJobIdInScheduleChain.Guid -ne $Null} | select name
Thanks.
Abelgdour
Novice
Posts: 5
Liked: never
Joined: Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour
Contact:

Re: after job info through PowerShell

Post by Abelgdour »

Still get a empty output

We use Veeam B&R 8.0
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: after job info through PowerShell

Post by veremin »

The provided script should provide you with the list of linked jobs, so, I not sure what might be wrong in your case. Can you post a screenshot of linked jobs? Thanks.
tsightler
VP, Product Management
Posts: 6035
Liked: 2860 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: after job info through PowerShell

Post by tsightler »

Any chance it happens to be Windows 2008R2 with an older Powershell version? I've seen lots of strange behavior if you're not on at least Powershell 3.0, most commonly on Windows 2008R2 with the default built in Powershell (v2 I think). If I run across a script that doesn't work as expected I always start with upgrading Powershell to at least the 3.0 version.
Abelgdour
Novice
Posts: 5
Liked: never
Joined: Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour
Contact:

Re: after job info through PowerShell

Post by Abelgdour »

We're running PowerShell V2. Iám going to update it to V3 and wil test the commando again

thx
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests