Hyper-V Version Numbers and VMM
At a client recently installing Virtual Machine Manager (VMM) we ran into a small annoyance. Because of the many Hyper-V patches available, not all of the Hyper-V systems that we wanted to manage with VMM matched in patch level and thus version level; the complete list of patches is available at: http://technet.microsoft.com/en-us/library/dd430893.aspx. The real annoyance wasn’t the patches themselves, it was figuring out the version each Hyper-V instance was at. I couldn’t find a good place in the Hyper-V GUI to tell me so it was off to my favorite search engine. From there I determined that the authoritative version number for Hyper-V is the file version of vmms.exe located in %systemroot%\system32. With that and a little WMI “magic”, I came up with thissinle command to run from the command-line:
wmic /node:"vmh-c01", "vmh-c02", "vmh-c03", "vmh-c04" datafile where name="c:\\windows\\system32\\vmms.exe" get CSName, version
This single line queried the file version of the vmms.exe executable on all four Hyper-V nodes using WMI and quickly returned the result. One gotcha was the syntax of the /node option for WMIC; it took me several minutes to get that perfect because initially, without each system name individually quoted, WMIC saw the dashes in the system names as additional, non-valid parameters resulting in an “Invalid Global Switch” error. Lumping them all together in a single set of quotes resulted in the same error.