PowerTip: Enable PowerShell Remoting with Public Network

PowerTip: Enable PowerShell Remoting with Public Network

  • Comments 2
  • Likes

Summary: Learn how to use Windows PowerShell 3.0 to enable Windows PowerShell remoting on a network adapter that has a public network profile.

Hey, Scripting Guy! Question How can I enable Windows PowerShell remoting on my system if the network adapter has a public firewall profile?

Hey, Scripting Guy! Answer Beginning with Windows PowerShell 3.0, you can use the Enable-PSRemoting cmdlet
          with the –SkipNetworkProfileCheck parameter:

Enable-PSRemoting -SkipNetworkProfileCheck 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • I was just playing with this today. One thing to be aware of is that this still limits connections to those on the local subnet and that will likely be exactly what you want. However, I had a aws ec2 instance that i wanted to remote to and opening it up to the outside did not bother me since I was not going to put anything I cared to lock down and would be tearing down the instance fairly soon.

    Basically , I wanted to deploy a Minecraft server using a set of modules I wrote (Boxstarter.org) that leverages remoting to install windows environments. To make this work simply means enabling a firewall rule like so:

    Set-NetFirewallRule -Name WINRM-HTTP-In-TCP-PUBLIC -RemoteAddress Any

    As long as you have ports 445 and 5985 open in your aws security, you can use sysinternals' psexec to do this:

    psexec \\blah.compute-1.amazonaws.com

    -u Administrator -p "yadayada" -h -d powershell.exe "Set-NetFirewallRule -Name WINRM-HTTP-In-TCP-PUBLIC -RemoteAddress Any"

    With that, I was able to deploy a Chocolatey package called bukkit (a popular minecraft server app) to the instance without touching the box via RDP. I put it up on a gist at gist.github.com/.../7454653.

  • nice work