Xylos brands

Connecting to Hyper-V 3.0 using Remote PowerShell

Besides upgrading the OS I also did most of the storage to my Synolgy NAS, starting using iSCSI etc… Enough changes to more or less have to rebuild the entire home lab. The server, running Hyper-V, is actually sitting on top of the "full-height" fridge and has no monitor, mouse or keyboard connected to it. The perfect motivation for wanting to use remote admin capabilities. However this proved to be more difficult than expected as both of the machines are in workgroup mode no PKI etc…

It took me some time to figure out how to make this possible, even when Windows Server 2012 is open for Remote PowerShell by default.

These are the steps it took to get it working:

1. Add the server to the "TrustedHosts" on my workstation:Set-Item wsman:\localhost\Client\TrustedHosts -Value "" -force2. Allow an unencrypted connection on the client sideSet-Item wsman:\localhost\Client\AllowUnencrypted -Value $true -Force3. Allow an unencrypted connection on the server sideset-item -force WSMan:\localhost\Service\AllowUnencrypted $true

After figuring this out, I was finally able to get these basic commands work:

$Srv = ""$Cred = "BEOKEHYPV00\Administrator"$Ssn = New-PSSession -ComputerName $Srv -Credential $CredImport-PsSession $Ssn -Module Hyper-V

Note the new capability in PSv3 that allows you to import a module from a remote host.

Share this blogpost

Also interesting for you

Leave a reply

Your email address will not be published. Required fields are marked.