July 11, 2025

USEFUL-IT

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:

Command:

Get-NetFirewallProfile | Set-NetFirewallProfile –Enabled False

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

Get-Command *firewall*

PSFirewall

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

netsh advfirewall set allprofiles state off

About The Author