Adding custom RDP port to Windows Firewall via PowerShell

I was playing with some remote access settings in my lab this morning and happened to lock myself out of my Hyper-V host. I had manually changed the RDP port to a custom port, 3391, and forgot to set the firewall rule to allow remote access. I could set it back to the default, but thought this would be a good time to do a little PowerShell.

It was very simple, you just have to get all the required parameters right. I already have PSRemoting enabled in my lab, so it was a snap to run theĀ New-NetFirewallRule command on the remote server.

I followed TheScriptingGuys post on adding firewall rules.

RDPconsoleThats it! Back in business!


Leave a Reply

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

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.