VMware Cloud Community
vmk2014
Expert
Expert

Finding VM's and Hosts in VC

Hi Everyone,

We have around 34 vcenter  across different region and it very difficult to find each VM/Host whenever any issues occurs.

Note :- 4 vcenters are in linked mode.

Can we find through power cli script  VM --> Host --> vCenter ?

Thanks

vmk

Tags (1)
0 Kudos
1 Reply
LucD
Leadership
Leadership

Provided you are connected to all vCenters, you could do something like this

Get-VM |

Select Name,@{N='VMHost';E={$_.VMHost.Name}},

   @{N='vCenter';E={ ([uri]$_.ExtensionData.Client.ServiceUrl).Host }}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos