The Windows Firewall contains three separately configurable firewalls, one each for public, private, and domain authenticated networks. Whenever your computer connects to a new network, Windows checks to see if that network provides a connection to a domain controller (if your computer is part of a domain). If a domain controller is found, the network connection profile and the firewall are set to domain authenticated. If a domain controller is not found, the user is prompted as to whether the network is public or private. This network profile determine which firewall configuration is used.
To check which network profile your computer is currently running with, you can use the following PowerShell cmdlet:
Get-NetConnectionProfile
This will result in output that resembles the following:
Notice that my computer's network connection profile is currently set to "DomainAuthenticated." Note that as a general rule, I would never disable the firewall for a Public interface, especially on a laptop.
To check the current state of the firewall for a DomainAuthenticated connection, you can use this PowerShell command:
Get-NetFirewallProfile -Name Domain
This results in the following output:
You can disable the firewall for the Domain profile using the following PowerShell command:
Set-NetFirewallProfile -Name Domain -Enabled False
You can change the name to Public or Private to change the state of those firewall profiles. Or, you can change multiple profiles with a single command like this:
Set-NetFirewallProfile -Name Domain,Private -Enabled False
And, of course, you can enable the firewall for a profile by changing the -Enabled False
to -Enabled True
.
If you found this blog helpful or have a question, please leave a comment.
Thanks for reading!