PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Find-VBRViEntity and tags

Post by matteu »

Hello,

I just discover if I use the command :
Find-VBRViEntity -name "test" -tag , the command will return all object with test name in vcenter like VM and TAG.
Shouln't it return only TAG because I specify -TAG ?

I can solve it with Find-VBRViEntity -Name "test" -Tags | where {$_.type -eq "Tag"} but I guess it should be the default behavior.
TitaniumCoder477
Veteran
Posts: 315
Liked: 48 times
Joined: Apr 07, 2015 1:53 pm
Full Name: James Wilmoth
Location: Kannapolis, North Carolina, USA
Contact:

Re: Find-VBRViEntity and tags

Post by TitaniumCoder477 »

Are you including the Server parameter? Per the documentation: "To get the necessary tags of the VMware objects, you must specify the vCenter Server in the Server parameter... If you don't provide the Server parameter, the cmdlet will return tags for all servers, added to a backup infrastructure." https://helpcenter.veeam.com/docs/backu ... ml?ver=120
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Find-VBRViEntity and tags

Post by matteu »

Thanks for your answer.
The cmdlet return all object in the vcenter with "test" name.
It's working fine with or without server parameter because it's not mandatory parameter and I have only 1 vcenter in my infrastructure.
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Find-VBRViEntity and tags

Post by matteu »

I just would like to know if it's the expected result or not ^^
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Find-VBRViEntity and tags

Post by oleg.feoktistov »

@matteu,

What VBR version are you trying this on?
Both in 12 and 12.1 I see only tags when executing the code below:

Code: Select all

Find-VBRViEntity -Name "Tag01" -Tags
When executing just Find-VBRViEntity -Tags, it's expected to see the whole view, which includes vCenter, tag categories, tags and vms. This scenario mirrors the UI.

Best regards,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Find-VBRViEntity and tags

Post by matteu »

I'm on the version 12.1.0.2131

You can look at my screenshot

Image
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Find-VBRViEntity and tags

Post by oleg.feoktistov »

Ok, I checked it further with other names (VMs, hosts etc.). Looks like it's by design as -Tags, -HostsAndClusters etc. parameters here represent views that correspond to what we have in the UI when adding an infrastructure item as a source for a job. So, in this case when -Tags parameter is used together with -Name, it will show you all the infrastructure items included in Tags view that has the name you passed, not only tag items.

Hope it helps,
Oleg
matteu
Veeam Legend
Posts: 725
Liked: 118 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Find-VBRViEntity and tags

Post by matteu »

Thanks for your answer.
That means I need à pipe and where object to filter as I mentionned right ?
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests