I'm running a dedicated server with Windows Server 2012 R2. Recently I locked myself out by Enabling Windows Firewall. No port rule was in place so the remote connection got blocked completely.

I had to order Firewall deactivation via the Serial Console (registry edit through Ubuntu) to be able to get in again. Right now Windows Firewall is disabled and I can only enable it by pushing the "Use recommended settings" button.

The problem is that I can't add a new In and OUT rule to the Firewall to enable Remote Connection without Enabling the Firewall again. I'm worried that if I enable it I'll be locked out again. Can't do it through PowerShell or netsh either because Firewall is disabled and cannot be edited.

Is there a way to add required rules in the registry or something so when I push that "Use recommended settings" button for the Firewall I'll not get disconnected and locked out?



To open the ports while the firewall is disabled start by making sure that the firewall service is enabled but not on. Now open up the Advanced Firewall snapin for MMC and select the Remote Desktop predefined rule for "In" only you DO NOT need outbound to remote in. Now select "Enable Rule" but when selecting the rules make sure not to select public unless your network connection is set this way. I have attached a picture for guidance.


You should now be able to start the Firewall service and stay connected as well as establish new connections.

Hope this helps.

  • Thank you for your reply. Unfortunately after the Firewall got disabled through editing Registry via Ubuntu it now shows like this (prnt.sc/bo75db) in the 'Windows Firewall with Advanced Security. I'm not sure how I can edit any settings in its current state and I'm literally afraid to touch anything because I don't want to be locked out again. – Sybar Jul 3 '16 at 11:01
  • As expected I enabled Windows Firewall in settings and it turned ON automatically. The effect is that I'm locked out again. Damn! – Sybar Jul 3 '16 at 11:51
  • I Enabled Windows Firewall in 'Services' and got locked out again. The weird thing is that after rebooting the server Firewall settings went back to 'Manual'. I can access my server again via Remote Desktop but the Firewall in Disabled again. Is it possible to prepare my dedicated server and client PC for a PowerShell connection so after enabling Firewall with default settings I'll still be able to edit the settings remotely using Power Shell? – Sybar Jul 3 '16 at 11:58
  • Are the computers in a domain or workgroup? – Charles Ludlow Jul 3 '16 at 19:47
  • Assuming a Domain config just run winrm quickconfig on the server and use valid domain admin credentials on the client and you should be set, a workgroup is a little more complex but I would be happy to provide instructions if needed. – Charles Ludlow Jul 4 '16 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.