I have a server that I know is a VM but I do not know what Hyper-V host it is on.
Open an elevated PowerShell prompts on the guest VM and enter the following:
(get-item “HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters”).GetValue(“HostName”)
The Hyper-V host name will be returned
NB: please be careful when pasting lines that have quotation marks into PowerShell and notepad, then into PowerShell. I’ve found the format of the quotation mark is not recognised and causes the command to fail. If in doubt, manually replace the quotation marks.
Disclaimer: provided “AS IS” with no warranties and confer no rights