How to disable Windows Firewall with PowerShell in Windows Server 2012 R2

 

When 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 8:

Command:

Get-NetFirewallProfile | 
Set-NetFirewallProfile –Enabled False

or

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled false

Vérifier que tout est bien passé en false :

Get-NetFirewallProfile | Select-Object Name,Enabled

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

Get-Command *firewall*

More information or sources:

EN Windows Firewall with Advanced Security Administration with Windows PowerShell

FR Administration du Pare-feu  Windows avec fonctions avancées de sécurité dans Windows PowerShell

Leave a Reply