I was trying to use PowerCLI to check if a host is connected to any vCenter? Checked all Get-VMHost related properties, but couldn't find it. Is it possible?
Did you try the State and ConnectionState properties ?
Get-VMHost | Select Name, State, ConnectionState
Both are the same, but State will become obsolete in a future PowerCLI build.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you are connecting directly to the esx host using powercli and looking for the vCenter that is it connected to you could use
get-vmhost | get-view | select {$_.summary.managementserverip}
Unfortunately this field only exists in ESX 4.x, I can't find anything equivalent for esx 3.x
Hi,
If you are using the PowerCLI, I assume that you are connecting to one VCenter server right ?
so may I know what's the goal of this question ?
I usually begin my Powershell with