Maybe there is a simple answer but I haven't found it yet.
If I am connected to multiple vCenters then look for and find an object (VM, host, etc) how can I tell which vCenter hosted the object PowerCLI found? You can .Parent all the way up to Datacenter object but I did not see where the DC object would help you determine the vCenter.
Thank you,
Kevin
These objects all have a link to the vCenter they belong to via the Client property.
For example
Get-VM |
Select Name,@{N='vCenter';E={([uri]$_.Client.ServiceUrl).Host}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I had to include ExtensionData ( $_.ExtensionData.Client.ServiceUrl ) but that got me there.
Thank you,
Kevin
Correct, I forgot the ExtensionData part.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference