PowerShell script exchange
Post Reply
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

List number of Objects in job

Post by dcd62 »

After the vm is failed over, the job still exists in the gui and the column "Objects in job" is "0". I would like to list the jobs that do not contain any vm's in it (the Objects in job column would be "0".

I tried this script, but it still shows an object name for the job where the Veeam gui shows "0"

Foreach ($Job in Get-VBRJob)
{
$Job | select name, {$_.GetObjectsInJob().name} | ft
}
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List number of Objects in job

Post by veremin »

Just to be sure - you've meant permanent failover, right?
dcd62
Enthusiast
Posts: 39
Liked: 4 times
Joined: Aug 20, 2014 1:00 pm
Contact:

Re: List number of Objects in job

Post by dcd62 »

Correct, permanent failover.
thanks
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: List number of Objects in job

Post by veremin »

Those objects are added to exclusions list automatically and get "Exclude" type inside PS. So, the idea will be to find replica jobs having zero "include" objects. The following one-liner should do the trick:

Code: Select all

Get-VBRJob | where {$_.JobType -eq "Replica"} | where {(($_.GetObjectsInJob() | where {$_.type -eq "Include"} | Measure-Object).Count -eq 0)}
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests