Manually setting Windows Firewall Profiles

What has always bugged me to some extend is that Microsoft removed the possibility to set the Windows firewall profile to my own liking. Not just let Windows decide what’s best. It normally does a pretty good job, but there are occasions where you want to change it manually. Unfortunately, in the network center, there’s no option to just change it. You could always mess around and change the specific network with a policy, but there’s an easier way. PowerShell to the rescue.

Set all firewall Profiles

Use this command to change all the network interfaces to the private profile:
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private

Or apply the public profile
Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Public

In case you would like the individual connections to have a different profile assigned you need to use a reference point. Use the Get-NetConnectionProfile first to get all the information about the locally installed network adapters.

In this case we use the “InterfaceIndex” number, but you could also use the adapter name, as long as it’s unique. Now that we have the reference (or entry) point we can use the Set-NetConnectionProfile cmdlet to set the correct state.

The command above sets the firewall profile for that specific adapter to the private profile. The options that are available are:

  • Public
  • Private
  • DomainAuthenticated

To validate the execution use the Get-NetConnectionProfile again.


Understanding Firewall Profiles

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s