List number of Objects in job

PowerShell script exchange

List number of Objects in job

Veeam Logoby dcd62 » Wed Jul 29, 2015 4:45 pm

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
}
dcd62
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Wed Aug 20, 2014 1:00 pm

Re: List number of Objects in job

Veeam Logoby v.Eremin » Wed Jul 29, 2015 4:49 pm

Just to be sure - you've meant permanent failover, right?
v.Eremin
Veeam Software
 
Posts: 13251
Liked: 965 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: List number of Objects in job

Veeam Logoby dcd62 » Mon Aug 10, 2015 2:15 pm

Correct, permanent failover.
thanks
dcd62
Enthusiast
 
Posts: 29
Liked: 4 times
Joined: Wed Aug 20, 2014 1:00 pm

Re: List number of Objects in job

Veeam Logoby v.Eremin » Tue Aug 11, 2015 6:02 pm

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


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests