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?