Script in PowerShell to disable the Windows firewall

Created by Alejandro Camps, Modified on Sun, 18 Dec 2022 at 02:11 AM by Alejandro Camps

This command uses the Set-NetFirewallProfile cmdlet to disable the firewall for all network profiles (domain, public, and private).


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


Keep in mind that disabling the Windows firewall can leave your computer vulnerable to malware attacks and other types of cyber threats. It is strongly recommended not to disable the firewall unless it is absolutely necessary and you have additional security measures in place.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article