PowerShell script exchange
Post Reply
alliance1
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2017 5:20 pm
Contact:

Get-VBRJobObject not returning all objects

Post by alliance1 »

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?
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRJobObject not returning all objects

Post by veremin »

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.
alliance1
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2017 5:20 pm
Contact:

Re: Get-VBRJobObject not returning all objects

Post by alliance1 »

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.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRJobObject not returning all objects

Post by veremin »

Edit job -> Virtual Machines -> Virtual Machines to backup.
alliance1
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2017 5:20 pm
Contact:

Re: Get-VBRJobObject not returning all objects

Post by alliance1 »

Ok, yes individual VMs are the job source.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRJobObject not returning all objects

Post by veremin »

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.
alliance1
Novice
Posts: 4
Liked: never
Joined: Jan 18, 2017 5:20 pm
Contact:

Re: Get-VBRJobObject not returning all objects

Post by alliance1 »

Yes, the objects are still missing.
veremin
Product Manager
Posts: 20413
Liked: 2301 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRJobObject not returning all objects

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests