locked
PowerShell Check If Hyper-V Is Installed In a Remote Windows 2008 R2 Server RRS feed

  • Question

  • Need a powershell script which I can execute from any computer -- Windows 7 OR later. From this machine, using the PowerShell script, remotely connect to another machine which can be Windows 2008 R2 OR later; to check if the target machine has Hyper-V installed.

    Step 1 --- I have a computer COMP01
    Step 2 --- From COMP01, I want to remotely connect to a Windows 2008 R2 Server namely, SERV01
    Step 3 --- After Connecting to SERV01, remotely from COMP01, I want to check if SERV01 (Windows 2008 R2 Server) has Hyper-V Installed

    I cannot use the:
    --- "Get-WindowsOptionalFeature -FeatureName" because it is available only on Windows 8.1 or later.
    --- "Get-WindowsFeature" cmdlet because in Windows 2008 R2 Hyper-V is available as a Role and not as a feature.
    --- "Get-WMIObject -Class Win32_ComputerSystem" and select the "HypervisorPresent" property because it is available ONLY on Windows 2012 OR Later

    I am looking for a script, guidance and suggestion, particularly on Step-3 as stated above.
    Basically, a PowerShell script that will work with all Client and Server OS staring from Windows7 OR later.
    Tuesday, August 18, 2015 3:58 PM

Answers

  • Class only works against servers.  Doesn't work on Windows 10 or Windows 8.

    get-service vmms -ComputerName <server name>


    \_(ツ)_/

    • Marked as answer by Monimoy Sanyal Wednesday, August 19, 2015 10:02 AM
    Tuesday, August 18, 2015 6:01 PM
  • It should work on a remote WS2008R2  server.  Get-Service can be used anywhere,


    \_(ツ)_/

    • Marked as answer by Monimoy Sanyal Wednesday, August 19, 2015 10:02 AM
    Tuesday, August 18, 2015 6:13 PM

All replies

  • Hi,

    Try Win32_ServerFeature.


    • Proposed as answer by jrv Tuesday, August 18, 2015 6:29 PM
    Tuesday, August 18, 2015 4:10 PM
  • Class only works against servers.  Doesn't work on Windows 10 or Windows 8.

    get-service vmms -ComputerName <server name>


    \_(ツ)_/

    • Marked as answer by Monimoy Sanyal Wednesday, August 19, 2015 10:02 AM
    Tuesday, August 18, 2015 6:01 PM
  • Class only works against servers.  Doesn't work on Windows 10 or Windows 8.

    get-service vmms -ComputerName <server name>


    \_(ツ)_/

    OP states this being ultimately run on WS2008R2 regardless of the entry point. Figured it'd be fine.


    Tuesday, August 18, 2015 6:03 PM
  • It should work on a remote WS2008R2  server.  Get-Service can be used anywhere,


    \_(ツ)_/

    • Marked as answer by Monimoy Sanyal Wednesday, August 19, 2015 10:02 AM
    Tuesday, August 18, 2015 6:13 PM
  • It should work on a remote WS2008R2  server.  Get-Service can be used anywhere,


    \_(ツ)_/

    Yeah yeah, but that's the EASY way...

    =]


    Tuesday, August 18, 2015 6:22 PM
  • No.  For the question you are right.  I just wanted to note that it only works on servers and not client HV hosts.

    Since WS2008R2 Hyper-V server is a standalone server the ODS type would also tell.

    The other issue is that the feature does not tell us that it is running.  The Service tells us if it is running.

    Lots of choices.


    \_(ツ)_/

    Tuesday, August 18, 2015 6:28 PM