If your question is about getting the VMs objects which have the tag assigned, then no, only the tag entity itself will be returned if you query by a tag name.
As for the documentation, that type is missing from the list, but is it the object type returned:
Code: Select all
$vc = Get-VBRServer -Name 'ausvcenter.fsglab.local'
$Tag = Find-VBRViEntity -Server $vc -Tags -Name "VeeamTagTest"
$Tag.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True CViTagItem System.Object
$Tag | gm
TypeName: Veeam.Backup.Core.Infrastructure.CViTagItem
If you need to query VMs with a specific tag, you'd need to capture all of the tag objects first and compare to the path of the specific tag that you are trying to match (tag to be matched in below example is 'VeeamTagTest'):
Code: Select all
$TagName = "VeeamTagTest"
$vc = Get-VBRServer -Name 'ausvcenter.fsglab.local'
$AllTags = Find-VBRViEntity -Server $vc -Tags
$SpecificTag = $AllTags | Where-Object {$_.Name -eq $TagName -AND $_.Type -eq 'Tag'}
$AllTags | Where-Object { $_.Path -like "$($SpecificTag.Path)*"}
(Results shortened for space)
Type : Tag
Reference : urn:vmomi:InventoryServiceTag:76fce34f-b97d-426d-95fd-8a659038a4da:GLOBAL
TagQsId : urn:vmomi:InventoryServiceTag:76fce34f-b97d-426d-95fd-8a659038a4da:GLOBAL
Id : 5000abb5-f13d-4434-a48d-bec0763f68f3_urn:vmomi:InventoryServiceTag:76fce34f-b97d-426d-95fd-8a659038a4da:GLOBAL
Name : VeeamTagTest
Path : ausvcenter.fsglab.local\VeeamBackup\VeeamTagTest
Description : Job Tag for Veeam Backups
Type : Vm
Name : ausvcenter
Path : ausvcenter.fsglab.local\VeeamBackup\VeeamTagTest\ausvcenter
Type : Vm
Name : ausdc01
Path : ausvcenter.fsglab.local\VeeamBackup\VeeamTagTest\ausdc01
Type : Vm
Name : ausveeambr
Path : ausvcenter.fsglab.local\VeeamBackup\VeeamTagTest\ausveeambr
I'll send a note to the docs team to update the list to include the 'CViTagItem' type.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion