Tuesday, September 22, 2009

MS: Enable and Disable Windows 2008 R2 Firewall from Command Line

Disable Windows 2008 R2 Firewall from Command Line:

Domain Profile:
Netsh advfirewall set domainprofile state off

Private Profile:
Netsh advfirewall set privateprofile state off

Public Profile:
Netsh advfirewall set publicprofile state off

To enable the firewall replace the OFF at the end of the sentence for ON.


the_boss said...

Worked great! I had problems disabling Windows 2k8 firewalls via scripting and this works. Thanks for article.

Woter said...

Unfortunaly, it doesn't work. netsh returns OK! but in Server Manager, the fw marked as Public (that's not actually public) shows as on. Microsoft: nobody in their right mind will ever, ever, ever, ever use your firewall, so please make it an optional component.

Maria Gabriela Martinez said...

hi, i have a server 2008 r2 with de service of the firewall down an i cant turn it on, it shows an error 0x6d9