Get-VBRJobObject not returning all objects

PowerShell script exchange

Get-VBRJobObject not returning all objects

Veeam Logoby alliance1 » Wed Jan 18, 2017 5:26 pm

I have a script which gets a list of all machines in all backup jobs. The script works well, except for the fact that some machines are inexplicably missing from the output.

I tested this by running Get-VBRJobObject -Job "myjob" and confirming that several machines are missing that do exist in the job via the Backup and Replication console. I'm using Powershell v4 on WinServer 2012 R2 and Veeam Backup & Replication 9.5.0.711.

Could this be a bug?
alliance1
Novice
 
Posts: 4
Liked: never
Joined: Wed Jan 18, 2017 5:20 pm

Re: Get-VBRJobObject not returning all objects

Veeam Logoby v.Eremin » Wed Jan 18, 2017 5:44 pm

I've never seen this issue before. Can you tell whether those machines are not excluded from processing? What is selected as job source? Individual VMs or container such as folder, resource pool, etc.? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRJobObject not returning all objects

Veeam Logoby alliance1 » Wed Jan 18, 2017 6:05 pm

They are not excluded from processing, the console shows that they've been backed up successfully.

How do I check the job source? The jobs back up individual VMs.
alliance1
Novice
 
Posts: 4
Liked: never
Joined: Wed Jan 18, 2017 5:20 pm

Re: Get-VBRJobObject not returning all objects

Veeam Logoby v.Eremin » Wed Jan 18, 2017 6:55 pm

Edit job -> Virtual Machines -> Virtual Machines to backup.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRJobObject not returning all objects

Veeam Logoby alliance1 » Wed Jan 18, 2017 7:06 pm

Ok, yes individual VMs are the job source.
alliance1
Novice
 
Posts: 4
Liked: never
Joined: Wed Jan 18, 2017 5:20 pm

Re: Get-VBRJobObject not returning all objects

Veeam Logoby v.Eremin » Fri Jan 20, 2017 12:45 pm

What happens if you get job objects a bit differently?

Code: Select all
Asnp VeeamPssnapin
$Job = Get-VBRJob -Name "Name of your backup job"
$Job.GetObjectsInJob()


Will the said entities still be missing?

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBRJobObject not returning all objects

Veeam Logoby alliance1 » Fri Jan 20, 2017 2:54 pm

Yes, the objects are still missing.
alliance1
Novice
 
Posts: 4
Liked: never
Joined: Wed Jan 18, 2017 5:20 pm

Re: Get-VBRJobObject not returning all objects

Veeam Logoby v.Eremin » Mon Jan 23, 2017 12:56 pm

Quite strange, indeed. The last method gets information directly from db by querying it. So, the problem doesn't seem to be PS-specific.

This is a query that the said method utilizes. I couldn't imagine that something is wrong with it:

Code: Select all
SELECT oijs.* FROM [dbo].[ObjectsInJobsView] oijs WHERE   oijs.[job_id] = @row_job_id ORDER BY order_no ASC;

You can run it yourself or preferably let support team do that, check the results of its execution, and investigate why there is a discrepancy between two values, if the given query also returns wrong data.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 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 4 guests