This is an archive version of the document. To get the most up-to-date information, see the current version.

Find-VBRViEntity

Short Description

Looks for VMware entities created on a selected host.

Applies to

Platform: VMware

Product Edition: Standard, Enterprise, Enterprise Plus

Syntax

Find-VBRViEntity [-Server <CHost[]>] [-HostsAndClusters] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Server <CHost[]>] [-VMsAndTemplates] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Server <CHost[]>] [-DatastoresAndVMs] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Server <CHost[]>] [-HostsAndDatastores] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Server <CHost[]>] [-ResourcePools] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Server <CHost[]>] [-Servers] [-Name <String[]>] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

-OR-

Find-VBRViEntity [-Name <String[]>] [-Server <CHost[]>] [-Tags] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]

Detailed Description

This cmdlet returns VMware objects connected to a specified ESXi host.

You can get the list of all VMware entities registered in your virtual VMware environment or narrow down the search results to specific objects, or look for instances directly by name.

Run Get-VBRServer to get the list of the VMware hosts.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

Name

Specifies the array of entity names. The cmdlet will return entities with these names.

False

Named

True

True

Server

Specifies the array of ESXi hosts. The cmdlet will return entities created on these hosts.

False

Named

True (ByValue,
ByProperty
Name)

False

HostsAndClusters

Defines that the cmdlet will return only hosts and clusters.

False

Named

False

False

VMsAndTemplates

Defines that the cmdlet will return only VMs and templates.

False

Named

False

False

DatastoresAndVMs

Defines that the cmdlet will return only datastores and VMs.

False

Named

False

False

HostsAndDatastores

Defines that the cmdlet will return only hosts and datastores.

False

Named

False

False

ResourcePools

Defines that the cmdlet will return only resource pools.

False

Named

False

False

Servers

Defines that the cmdlet will return only VMware hosts.

False

Named

False

False

Tags

Defines that the cmdlet will return only tags.

Note:

  • To get the necessary tags of the      VMware objects, you must specify the vCenter Server in the Server parameter.
  • To specify the tag name, use the Name parameter.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Return Type

CVcItem

CViFolderItem

CViDatacenterItem

CEsxItem

CViClusterItem

CViResourcePoolItem

CViVmItem

CViVirtualAppItem

CViFolderItem

CViDatacenterItem

CViTagItem

Examples

Find-VBRViEntityExample 1. Getting List of Hosts and Clusters Connected to Specific ESXI Hosts

This examples shows how to get a list of  hosts and clusters that are connected to the following ESXi hosts: ESXiHost 01 and ESXiHost 02.

$server = Get-VBRServer -Name "ESXiHost 01", "ESXiHost 02"

Find-VBRViEntity -HostsAndClusters -Server $server

Perform the following steps:

  1. Run the Get-VBRServer cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Find-VBRViEntity cmdlet. Set the $server variable as the Server parameter value. Provide the HostsAndClusters parameter.

Find-VBRViEntityExample 2. Getting Specific Cluster from ESXI Host

This examples shows how to get the vSAN ESXi cluster named located on the ESX01 ESXiHost.

$server = Get-VBRServer -Name "ESX01"

Find-VBRViEntity -Server $server -HostsAndClusters -Name vSAN

Perform the following steps:

  1. Run the Get-VBRServer cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Find-VBRViEntity cmdlet. Specify the following settings:
  • Set the $server variable as the Server parameter value.
  • Provide the HostsAndClusters parameter.
  • Specify the Name parameter value.

Find-VBRViEntityExample 3. Getting List of Resource Pools

This examples shows how to get a list of resource pools with names starting with Veeam. The resource pools are located on the ESX01 ESXi host.

$server = Get-VBRServer -Name "ESX01

Find-VBRViEntity Server $server -ResourcePools -Name Veeam*

Perform the following steps:

  1. Run the Get-VBRServer cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Find-VBRViEntity cmdlet. Specify the following settings:
  • Set the $server variable as the Server parameter value.
  • Provide the ResourcePools parameter.
  • Specify the Name parameter value.

Find-VBRViEntityExample 4. Getting List of VMware Tags

This examples shows how to get a list of the Mac OS VMware tags within the vcenter05.tech.global vCenter.

$server = Get-VBRServer -Name vcenter05.tech.global

Find-VBRViEntity -Server $server -Tags -Name "Mac OS"

Perform the following steps:

  1. Run the Get-VBRServer cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Find-VBRViEntity cmdlet. Specify the following settings:
  • Set the $server variable as the Server parameter value.
  • Provide the Tags parameter.
  • Specify the Name parameter value.

Find-VBRViEntityExample 5. Getting List of VMs with Specific VMware Tags

This examples shows how to get a list of VMs that have the Mac OS VMware tag within the vcenter05.tech.global vCenter.

$server = Get-VBRServer -Name vcenter05.tech.global

$AllTags = Find-VBRViEntity -Server $server -Tags

$TagName = "Mac OS"

$SpecificTag = $AllTags | Where-Object { $_.Name -eq $TagName -AND $_.Type -eq 'Tag' }

$AllTags | Where-Object { $_.Path -like "$($SpecificTag.Path)*" -AND $_.Type -eq 'VM' }

Perform the following steps:

  1. Run the Get-VBRServer cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  2. Run the Find-VBRViEntity cmdlet. Specify the Server and Tags parameters. Save the result to the $AllTags variable.
  3. Create the $TagName variable specify the necessary value. This value represents the VMware tag. In our case it is the Mac OS value.
  4. Get the necessary tag from a list of all tags:
  1. Create the $SpecificTag variable and assign it to the $AllTags variable.
  2. Pipe the cmdlet output to the Where-Object cmdlet.
  3. Open the curly bracket. Specify the Name property of the $_. automatic variable. Set the $TagName variable as the eq parameter value. Provide the AND logical operator. Specify the Type property of the $_. automatic variable. Set the $Tag variable as the eq parameter value. Close the curly bracket.
  1. Get a list of a list of VMs that have the Mac OS VMware tag:
  1. Pipe the $AllTags variable output to the Where-Object cmdlet.
  2. Open the curly bracket. Specify the Path property of the $_. automatic variable. Provide the "$($SpecificTag.Path)*" value for the Like parameter. Provide the AND logical operator. Specify the Type property of the $_. automatic variable. Set the VM variable as the eq parameter value.

Related Commands