After installing Exchange Server, the next step is to configure internal DNS for Exchange. It's…
How to disable the Windows Firewall with PowerShell in Windows Server 2012/2016/2019? I don’t recommend turning off the Windows Firewall with PowerShell. But if you have a test lab and want to disable it for testing, go ahead. Don’t forget to enable the Firewall when you finish testing. In this article, you will learn how to disable Windows Firewall with PowerShell.
Table of contents
Windows Firewall profiles information
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.
In the next step, we are going to disable the Windows Firewall.
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
Windows Firewall is disabled on all three profiles in Windows Server. Have fun testing. Don’t forget to enable the Windows Firewall after you have finished troubleshooting or testing. It’s important to keep the Windows Firewall turned on.
You learned how to disable the Firewall in Windows Server 2012/2016/2019/2022. First, get the current status of the Windows Firewall. After that, disable the Windows Firewall with PowerShell. As of last, verify that the Windows Firewall is disabled.
Did you enjoy this article? If so, you may like Windows Server post-installation configuration. Don’t forget to follow us and share this article.