This content has been marked as final.
Show 3 replies
-
1. Re: Get-View Guest.Hostname property returning null
DZ1 Jun 24, 2015 9:31 AM (in response to amarcy)$_.Guest.Hostname is not the ESXi host, it's the name of the VM. You could see the host by selecting Get-VMhost -id $_.Runtime.Host, since you're using Get-View.
-
2. Re: Get-View Guest.Hostname property returning null
amarcy Aug 4, 2015 12:08 PM (in response to DZ1)Sorry for the late reply. I understand that $_.Guest.Hostname returns the VM machine name. My problem is that the query is returning nothing in the second part of my select statement. The first column should return the VM name, and the second column should return the VM machine name. I don't know why it's not returning the latter.
And just to clarify, I'm not interested in the ESXi host name. Thanks.
-
3. Re: Get-View Guest.Hostname property returning null
amarcy Aug 4, 2015 12:25 PM (in response to amarcy)Figured it out, I was missing the Guest.HostName property when defining parameters of get-view:
Get-View -ViewType VirtualMachine -Property Name, Guest.HostName