Try like this
Get-VMHost | Get-VMHostAuthentication | select @{N='ESX';E={$_.VMHost.Name}},Domain
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi ,
There is a very beautiful tool available in market known as RVTools. By running this tools you get a very good and high level of information in every manner of VMware say Datastore , host , VM , etc.
When you will run this tool to generate a report in that you will get Host tab sheet wherein you will get all details related to host and the detail what you required.
According to me its a safe tool compare to scripting as scripting can provide error on wrong parameters if insert.
Although I'm a big fan of RVTools, you did notice that this is the PowerCLI community under the Automation Tools folder :smileygrin:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference