You have HyperV installed somewhere… somewhere you are not currently at. Oh, and you are on a domain currently, and it is on in a workgroup and you cannot use HyperV Manager to connect. What do you do?
The first thing to do is to enable and configure Windows PowerShell remoting. To do this, use the Enable-PSRemoting cmdlet.
- Open a Powershell Terminal with “Run as Administrator” and type Enable-PSRemoting.
Next we need to add the DNS name (or IP if you really need to) to TrustedHosts in WINRM.
- winrm set winrm/config/Client ‘@{TrustedHosts=”fully_qualified_server_name, server machine name”}’
After that, we connect to the remote HyperV server. The method below will prompt you for credentials.
-
Enter–PSSession hostname –Credential (Get–Credential)
Next, we enable Remote Desktop Connections.
- Enable Remote Desktop
set-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Terminal Server’-name “fDenyTSConnections” -Value 0 -
Allow incoming RDP on firewallEnable-NetFirewallRule -DisplayGroup “Remote Desktop”
-
Enable secure RDP authenticationset-ItemProperty -Path ‘HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp’ -name “UserAuthentication” -Value 1
That should be it. Now, we can close the PowerShell remote connection. (Or just close the PowerShell window if you are lazy.)
- Exit-PSSession
I hope this helps. Its pretty straightforward… but, if you are unfamiliar with adding Trustedhosts to winrm… it might take you a while.