Enable Windows Remote Desktop Protocol and Set Firewall Rules using PowerShell


If you are using Windows Server 2012 or newer, or if you are just using Windows Server Core, then this Powershell script will help you out by enabling Remote Desktop and setting the correct firewall inbound rules.

Simply open up an elevated Powershell command box, or use Powershell ISE and use the two scripts below, one to enable Remote Desktop and then the second to set the firewall ports correctly.

Enable Remote Desktop

Enable Inbound Firewall Rule

Now if you try and remote desktop on your server, it should prompt for a login and go straight in.


If you have any questions or feedback on this article, please feel free to leave us a message below in our comments section.

2 Responses

  1. Will it work on Workgroup Computers or only domain joined?

Leave us a message...