Hyper-V 3.0 Remote PowerShell Connection

Last weekend I upgraded both my laptop and server, a desktop with an attitude actually, to Windows 8 and Windows Server 2012. One of the improvements I’m personally longing for is the extended support for PowerShell v3.

Besides upgrading the OS I also most of the storage to my Synolgy NAS, started 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 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 tow 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 (ref: http://technet.microsoft.com/en-us/library/hh847850.aspx):

Set-Item wsman:\localhost\Client\TrustedHosts -Value "" -force

2. Allow an unencrypted connection on the client side (ref: http://technet.microsoft.com/en-us/library/hh847850.aspx)

Set-Item wsman:\localhost\Client\AllowUnencrypted -Value $true -Force

3. Allow an unencrypted connection on the server side (ref: http://stackoverflow.com/questions/1469791/powershell-v2-remoting-how-do-you-enable-unecrypted-traffic)

set-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 $Cred
Import-PsSession $Ssn -Module Hyper-V

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



Tagged with: ,
Posted in PowerShell, Virtualization
IT Pro Summer GP
IT Pro Summer Grand Prix

IT Pro Summer Grand Prix

Microsoft Virtual Academy

MS Virtual Academy

Pro-Exchange / Pro-Lync / Pro-Office365

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 158 other followers

%d bloggers like this: