The problem is that this command lists the correct source (vmware tag) plus many other individual VMs that are not present in the Virtual Machines section of the job in the GUI.
Is there a reliable way I can extract this info from all jobs?
I guess the problem is that Get-VBRJobobject returns multiple "object" objects: one with the correct source tag and all others with incorrect individual VMs
Your code works and I created a PowerShell script which loops through all jobs and gets this info. I sent you the code with the output in a PM. Please also review my in-script comments.
Of course the challenge with your above line is that source tags and source VMs cannot be reliably differentiated as they seem to fall under the same object category. For example a job that has both a tag and individual VMs in its source is going to be tricky to report on. is there a "{$_.GetObject().Info.ViType -eq "VM"}"? When I run this I get nothing:
$Job = Get-VBRJob -name "Name of your Backup job"
$Job | Get-VBRJobobject
If both tag and VMs are added to a backup job and you want to differentiate between them, then, it makes sense to output object type along with object name:
I can confirm that when I run this code against a job with only one tag in the source list, the output returned contains both the tag and VM objects that are members of the tag.
Cannot confirm the issue in my lab, it might stand to reason to reach our support team for further clarification - might be something environment-specific. Thanks!