Do you have integration components installed on the guest? If you do not, install ASAP. After the IC is updated, you can request host information from the registry of virtual machines, for example,
gp 'HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters'
HostName : hyperv100.contoso.local
HostingSystemEditionId : 8
...
PhysicalHostName : hyperv100
PhysicalHostNameFullyQualified : hyperv100.contoso.local
VirtualMachineName : guest101
(gp 'HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters').PhysicalHostName
hyperv100
(gp 'HKLM:\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters').PhysicalHostNameFullyQualified
hyperv100.contoso.local
Also, read the article that describes IC registry keys .
source
share