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: