after job info through PowerShell

PowerShell script exchange

after job info through PowerShell

Veeam Logoby Abelgdour » Mon Aug 24, 2015 9:35 am

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
Abelgdour
Novice
 
Posts: 5
Liked: never
Joined: Mon Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour

Re: after job info through PowerShell

Veeam Logoby v.Eremin » Mon Aug 24, 2015 10:49 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: after job info through PowerShell

Veeam Logoby Abelgdour » Mon Aug 24, 2015 12:30 pm

Hello Eremin,

Thankd for your post, but I get a emty output with your script
Abelgdour
Novice
 
Posts: 5
Liked: never
Joined: Mon Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour

Re: after job info through PowerShell

Veeam Logoby v.Eremin » Mon Aug 24, 2015 12:31 pm

Are you positive that you've specified name of a job other job is linked to, not the name of linked job itself?
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: after job info through PowerShell

Veeam Logoby Abelgdour » Tue Aug 25, 2015 7:48 am

Yes I'm positive
Abelgdour
Novice
 
Posts: 5
Liked: never
Joined: Mon Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour

Re: after job info through PowerShell

Veeam Logoby v.Eremin » Tue Aug 25, 2015 8:26 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: after job info through PowerShell

Veeam Logoby Abelgdour » Tue Aug 25, 2015 1:30 pm

Still get a empty output

We use Veeam B&R 8.0
Abelgdour
Novice
 
Posts: 5
Liked: never
Joined: Mon Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour

Re: after job info through PowerShell

Veeam Logoby v.Eremin » Tue Aug 25, 2015 1:52 pm

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: after job info through PowerShell

Veeam Logoby tsightler » Tue Aug 25, 2015 1:58 pm

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.
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: after job info through PowerShell

Veeam Logoby Abelgdour » Wed Aug 26, 2015 10:22 am

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

thx
Abelgdour
Novice
 
Posts: 5
Liked: never
Joined: Mon Aug 24, 2015 9:28 am
Full Name: Abderrahmane Belgdour


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests