How to check my windows server is virtual machine or physical machine

后端 未结 8 1260
谎友^
谎友^ 2020-12-31 09:45

I\'m remoting desktop to windows servers in our Lab/datacenter. I have a requirement to figure out all our servers are virtual machines or physical servers programatically,

相关标签:
8条回答
  • 2020-12-31 10:08

    To check this from the command prompt you can run this: systeminfo | find "System"

    Example output for virtual server:

    System Manufacturer:       Microsoft Corporation    
    System Model:              Virtual Machine    
    System Type:               x64-based PC
    

    Example output for physical server:

    System Manufacturer:       HP
    System Model:              ProLiant BL460c G6
    System Type:               x64-based PC
    
    0 讨论(0)
  • 2020-12-31 10:09

    Try this:

    FOR /F "tokens=*" %a IN ('wmic bios get bioscharacteristics^|find /c "33"') DO set USBlegacy=%a
    

    This returns "1" for the limited range of desktops and laptops in my environment and "0" for VMWare workstation 9, ESX 5.5, and Citrix 6.5 and 7.6. BIOSCharacteristic "50" (one "reserved for system vendor") I've only found in the four virtual environments so that would work in reverse.

    Edit: or there's this:

    FOR /F "tokens=*" %a IN ('wmic path win32_pnpentity get ^|find /c "ACPI Fan"') DO set ACPIfan=%a
    

    Returns "5" on an HP Desktop, "0" on VMware workstation 9 and ESX 5.5, not tested on the others.

    0 讨论(0)
提交回复
热议问题