moreabout.tech avatar

Testing Windows Firewall Settings Safely From Remote Machine

moreabout.tech

Published: 08 Feb 2019 › Updated: 08 Feb 2019Testing Windows Firewall Settings Safely From Remote Machine

Testing Windows Firewall Settings Safely From Remote Machine

A while back I got me a new crisp Windows Server. By default, the Firewall was turned off and of course I wanted to turn it on for security reasons. But what happens if I lose my connection to a server a few hundred miles away? How would I disable the firewall if I can't connect to it anymore? I decided to write a script!

The function of the script is to enable the firewall for the public internet, wait 2 minutes, then disable it again. Here is my script:

echo@echo off
Netsh Advfirewall set public state on
timeout 120
Netsh Advfirewall set public state off

Save those lines as a batch file, then run it as Administrator. Keep in mind to use this at your own risk! It saved me, but never know about you! An explanation of the commands can be found on my other post Turn Windows Firewall Off or On By Command Line Or Script.


Originally posted at https://moreabout.tech/testing-windows-firewall-settings-safely-from-remote-machine/

Leave Testing Windows Firewall Settings Safely From Remote Machine to:

Written by

Read more #technology posts


Best Posts From moreabout.tech

We have not curated any of moreabout.tech's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From moreabout.tech