Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 236436

Re: Listing the virtual center for a given host

$
0
0

Hello, -

 

There are (as always) several ways to go about this.  If using the Get-VMHost cmdlet, there are a few different properties that contain the vCenter info within their values.  Some such properties:  ".Uid", ".Client.ConnectionId", and ".Client.ServerUri".  So, you could grab the vCenter (or VIServer) name from any of those properties.  For example:

 

Get-VMHost | select Name,@{n="vCenter"; e={$_.Client.ServerUri.Split("@")[1]}}

 

The ".Client.ServerUri" value there is something like "443@myvcenter.domain.com", so the calculated property splits on the "@" and then returns the item at index 1 (the part after the "@"), resulting in "myvcenter.domain.com".

 

Then, of course, add in your other properties that you are selecting/calculating.  How does that do for you?


Viewing all articles
Browse latest Browse all 236436

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>