Editors Note: One the System Engineers that run the servers that host www.Microsoft.com told me that he wanted to start posting some of the methods and tips and tricks that they use when managing one of the most heavily visitied web site in the world. This post kicks off this series.
1) How to remotely find out if a machine has Hyper V is installed?
When you install the hyperv Role on windows 2008 it updates the BCD store (replacement of boot.ini in 2008 & Vista) of the machine with an entry "hypervisorlaunchtype" and sets it to auto. So you can remotely query the BCD store of a machine to find out if Hyper V is installed or not.
Here is a quick way from command prompt you can use the following command if you have psexec in the system path . You can use WINRS too, but psexec seems to be easy.
psexec \\machinename bcdedit | find "hyper"
e.g.) C:\>psexec \\hypervhost2k8 bcdedit | find "hyper" PsExec v1.94 - Execute processes remotelyCopyright (C) 2001-2008 Mark RussinovichSysinternals - www.sysinternals.com hypervisorlaunchtype Autobcdedit exited on hypervhost2k8 with error code 0.
There are other quick ways too by checking existence of vmbus.sys, hvboot.sys and using WMI to query BCD.
2) How to remotely find out which is the Physical host of a VM?
In HyperV language physical host is a machine that hosts the root partition and guest will be called a
child partition installed on top of HyperV. You can remotely query the registry value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters\hostname of the child partition to find out the machine name that hosts the root partition. Here is command that can be run remotely reg query "\\machinename\HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters" /V hostname e.g.) C:\>reg query "\\hypervguest01\HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters" /v physicalHostName
PhysicalHostName REG_SZ hypervhost2k8