Turn Windows Firewall Off or On By Command Line Or Script

I have run into a few times when I needed to turn off or on the Windows Firewall via command line or script. It is actually very simple to do!

To Turn Off:
NetSh Advfirewall set allprofiles state off

To Turn On:
NetSh Advfirewall set allrprofiles state on

To check the status of Windows Firewall:
Netsh Advfirewall show allprofiles

You can replace “allprofiles” with public, domain, or private and you can manipulate just that one profile. I used this in creating a script to test the firewall settings of a remote server. That way if I messed up the config, it would turn itself back off after a minute and I was able to reconnect to it. You can view that script on my other post Testing 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 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.

Where have you been? Google knows!

Google Location History Map

Do you have Google anything installed on your phone? Computer? Tablet? If so, chances are Google knows – and records – everywhere you have been!

Google will save this data if you have these two settings turned on:

  1. Location Reporting
  2. Location history

Now your thinking, if I have the option to turn this on or off why would it even be on? There are many things Google uses (and collects) this data for. Ever searched for a pizza place like “Papa Johns” and Google somehow magically showed the results for your location rather than some random place in the world? Google uses your location data to narrow down the results.

Maybe you use Google Now. Google now HIGHLY integrates with your location data. In fact, every so many minutes, it scans for your location and reports it so you can get interesting cards on your Google Now interface.

 

Google offers step by step instructions on how to remove all your location history and how to turn it off. You can find the instructions to turn off Location History by clicking HERE.

Now comes the fun part – you can actually see where all Google knows you have been by ensureing you  are logged in to your main Google account, and clicking the following address:

https://maps.google.com/locationhistory/b/0

Here are a couple example screenshots (click to enlarge):

Google Location History 1
Google Location History 1
Google Location History 2
Google Location History 2

So you decide, is it worth leaving this on for the cool features that Google offers? I love the features of Google Now, but it is a little scary to see just how often Google tracks your location for this feature.