September 25, 2021


A blog for USEFUL-IT information

How to disable Windows Firewall with PowerShell in Windows Server 2012

Firewall_BWhen you build non-production lab environment internal  Windows Firewall could be source of connectivity errors. Usually I’m disabling Windows Firewall at all.

From command prompt with PowerShell you can easily disable Firewall in Windows Server 2012:


Get-NetFirewallProfile | Set-NetFirewallProfile –Enabled False

For your information: we can easy find Firewall-related PowerShell cmdlets with following request:

Get-Command *firewall*


You can also disable the Firewall from a command line without powershell
Run the following command :

netsh advfirewall set allprofiles state off