Testing Windows Firewall Settings Safely From Remote Machine

in #technology5 years ago

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 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/

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66384.36
ETH 3272.25
USDT 1.00
SBD 4.27