locked
Prerequisite to run Get-VM RRS feed

  • Question

  • Hi,

    I'm fairly new to Hyper-V and I'm having some difficulties to get all the VMs on the local network of my office.

    With the "Get-Command -Module Hyper-V" cmdlet I can see that the "Get-VM" cmdlet is present on my list.

    Then I run as Administrator "Get-VM" but it returns an empty list.

    Opening the Virtual Machine Manager I can see the two VMs which in I'm interested in, both of them have the Computer Name set to:
    - Server-UTFRC.CompanyName.local
    - Server-UTFRP.CompanyName.local

    And run on Windows Server 2016 standard.

    Is there some setting that I need to activate to made them accessible ? 
    I'm not the one who configured the local network, but I have access to VMM and I have admin privileges.

    Thanks for help.
    Best regards.



    • Edited by Pickeroll Friday, August 3, 2018 10:19 AM
    Friday, August 3, 2018 10:10 AM

All replies

  • You mention VMM - are you trying to use System Center Virtual Machine Manager?

    Are the VMs you are trying to see located on the machine from which you are running the Get-VM PowerShell cmdlet?

    PowerShell Get-VM and VMM are two different management tools.  It would be helpful to know exactly what you are using and trying to do.


    tim

    Friday, August 3, 2018 12:41 PM
  • I think you are looking for Get-SCVirtualMachine included in the VirtualMachineManager module.

    Friday, August 3, 2018 1:49 PM
  • My approach would be to use either of these;

    1. Logon to the Hyper-V servers and scan them for a list of VMs.

    OR

    2. Connect to each of the machine & execute [wmic computersystem get model]. If that's MODEL says Virtual Machine, that's a VM.


    yup

    Friday, August 3, 2018 3:56 PM
  • Thanks for the reply !

    You mention VMM - are you trying to use System Center Virtual Machine Manager?

    Yes I'm using System Center Virtual Machine Manager to check VMS and Properties.

    Are the VMs you are trying to see located on the machine from which you are running the Get-VM PowerShell cmdlet?

    Nope, the VMS are not on my machine. I read that I need the -computername attribute to direct my Get-VM command in the right machine.

    So with Remote Desktop on the VM I found that the name of the VM is "Server-UTFRC", so I run the command:

    Get-Vm -computerName Server-UTFRC

    But this error came out:

    Get-Vm : The Hyper-V Management Tools could not access an expected WMI class on computer 'Server-UTFRP'. This may
    indicate that the Hyper-V Platform is not installed on the computer or that the version of the Hyper-V Platform is
    incompatible with these management tools.


     








    • Edited by Pickeroll Monday, August 6, 2018 8:58 AM
    Monday, August 6, 2018 8:06 AM
  • The command Get-Vm -computerName Server-UTFRC is instructing PowerShell to return that name of all VMs that exist on Hyper-V host Server-UTFRC.  You said the name of the VM you were connecting to was Server-UTFRC.  So you were trying to get the name of all the VMs on the server you were connecting to.  You are headed in the right direction if you want to find the name of all the VMs on a particular host, but what you need to specify the name of the host on which the VMs are running to the Get-VM command, not the VM to which you are connecting.

    See https://docs.microsoft.com/en-us/powershell/module/hyper-v/get-vm?view=win10-ps for a full description of the Get-VM command.


    tim


    Monday, August 6, 2018 12:54 PM