Skip to main content

Firewall

Windows Firewall offers three firewall profiles:

  • Domain profile: applies to networks where the host system can authenticate to a domain controller.
  • Private profile: a user-assigned profile and is used to designate private or home networks.
  • Public profile: this is the default profile. It is used to designate public networks such as Wi-Fi hotspots at coffee shops, airports, and other locations.

Get status of the Windows Firewall with PowerShell

First, let’s get the current status of the Windows Firewall. We will be using the Get-NetFirewallProfile cmdlet.

PS C:\> Get-NetFirewallProfile | Format-Table Name, Enabled

Name    Enabled
----    -------
Domain     True
Private    True
Public     True

We have three profiles: Domain, Name, and Public. Windows Firewall is enabled on all three profiles.

 

Disable Windows Firewall in Windows Server 2012/2016/2019

Disable Windows Firewall on all three profiles.

PS C:\> Set-NetFirewallProfile -Profile Domain, Public, Private -Enabled False

Check Windows Firewall status

Check the status after you disable the Firewall on all three profiles. Run the Get-NetFirewallProfile cmdlet.

PS C:\> Get-NetFirewallProfile | Format-Table Name, Enabled

Name    Enabled
----    -------
Domain    False
Private   False
Public    False