0

Is there a WMI query that provides the Domain of a VM deployed on a Microsoft Hypervisor? Also, we will be querying the Hypervisor for the same.

1 Answers1

0
(get-wmiobject -class Win32_ComputerSystem).domain

will give you the domain information. Further information here: https://msdn.microsoft.com/en-us/library/aa394102(v=vs.85).aspx

You could also try:

get-wmiobject -class Win32_ComputerSystem | select-object Name,Domain,DomainRole

This will tell you the type of server also. Standalone Workstation (0) Member Workstation (1) Standalone Server (2) Member Server (3) Backup Domain Controller (4) Primary Domain Controller (5)

https://blogs.technet.microsoft.com/benp/2008/08/11/scripting-hyper-v-with-wmi-and-powershell-part-1-introduction-querying-state/ has further information on HyperV.

HyperV WMI provider is located here: https://msdn.microsoft.com/en-us/library/cc136992(VS.85).aspx

Hope this helps.

Thanks, Tim.

Tim Haintz
  • 628
  • 1
  • 6
  • 9