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


I am a Technical Specialist - Cloud Infrastructures from the Netherlands.
My Skills are mainly PowerShell, VMWare, Hyper-V, Microsoft System Center products and Windows Azure Pack.

I work for a company in Utrecht The Netherlands.
Updated: December 20, 2015 — 22:31