Hyper-V Manager - How do I Connect to Hyper-V Server using different credentials

76,709

Solution 1

Add the target account credentials to the Windows Credential Manager from the command line and try reconnecting:

cmdkey /add:TARGET /user:TARGET\USER /pass

Where TARGET is the remote Hyper-V host name and USER is the username added as an Administrator to the Hyper-V server.

As an aside, after having struggled with this configuration myself, I highly recommend running HVRemote on the client and server to aide in troubleshooting potential issues.

Solution 2

Hold Shift while you right-click "Hyper-V Manager", select "Run as different user", and enter credentials that have rights to manage Hyper-V.

Runas would also work if you use this syntax:

runas /user:domain\username /netonly "mmc virtmgmt.msc"

Solution 3

You can launch mmc with runas and then select the snap in e.g.

runas /user:AlternativeUsername mmc

It's worth reading this complete guide which will get you a nice shortcut too:

Running the Hyper-V Management Tools with Alternate Credentials

Solution 4

If you want to connect to a Hyper-V Server that is NOT part of a DOMAIN, you can use this trick:

runas /user:NAME_OF_HYPERV_SERVER.\Administrator /netonly "mmc virtmgmt.msc"

IMPORTANT NOTE: Take notice of the period AFTER the server name.

So, if you are on a Windows 10 Machine, and do NOT want to connect to the hyper-v installed on your machine, but to another hyper-v server on your local network, and it is NOT part of a domain, you can use this. If you hyper-v server is named crunchy, then this would be the line to use:

runas /user:crunchy.\Administrator /netonly "mmc virtmgmt.msc"

Of course, this also assumes your Administrator account is called Administrator.

Enjoy!

Share:
76,709

Related videos on Youtube

finisterre
Author by

finisterre

Updated on September 18, 2022

Comments

  • finisterre
    finisterre almost 2 years

    I have Hyper-V Server 2012 (free version) running on a box that is not on any domain.

    My Windows 8.1 laptop is on our domain. Both machines are on the same physical network.

    On my laptop, when I run Hyper-V Manager and attempt to CONNECT TO SERVER I get:

    An error occurred while attempting to connect to server "192.168.100.15". Check that the Virtual Machine Management Service is running and that you are authorized to connect to the server.

    You do not have the required permission to complete this task. Contact the administrator of the authorization policy for the computer '192.168.100.15'

    What can I do? There is no option to specify alternate credentials. I tried to create a local user on the Hyper-V Server with the same name as the domain user on the laptop, but couldn't since the domain userid is in the format [email protected].

    • Piotr Kula
      Piotr Kula over 6 years
      I installed Server Manager for Windows (8,10) - Added the HyperV server to the servers. HyperV showed up in the left panel. Clicked on that, then right click on server. Manage HyperV. The HyperV Manger shows up as usual (no visual differences), click connect, boom! Connected! No other solution worked for me but this... (all this is different workgroups with no domains setup)
  • finisterre
    finisterre over 10 years
    I have created a local user on the domain laptop with the same name as an administrator account on the server. Running the above in a Command Prompt as Administrator gives: 740 The requested operation requires elevation.
  • Colin Pickard
    Colin Pickard over 10 years
    you might need runas /user:SERVER\Administrator mmc where SERVER is your target Hyper-V server hostname