Anyway to deterine what ESX host a VM is running on from withing the guest OS itself. Maybe using a vmware-service.exe command? Or do I have to rely on SDK command to do it?
If the guest is running Microsoft Windows you can use VMware vSphere PowerCLI to retrieve the host with the next PowerCLI script:
Connect-VIServer YourvCenterServerName -Credential (Get-Credential) $Computername = (Get-ChildItem env:COMPUTERNAME).Value (Get-VM -Name $ComputerName | Get-VMHost).Name Disconnect-VIServer -Confirm:$false
Regards, Robert
This script only works if the VM name is the same as the name in the virtual center server and that you enforce that names are unique