---
title: "Disabling Windows Firewall: A Comprehensive Guide"
description: "Learn various methods to disable the Windows firewall, including GUI tools, PowerShell, command-line, and group policy."
canonical: "https://adamtheautomator.com/disable-windows-firewall/"
---

# Disabling Windows Firewall: A Comprehensive Guide

> Learn various methods to disable the Windows firewall, including GUI tools, PowerShell, command-line, and group policy.

Source: https://adamtheautomator.com/disable-windows-firewall/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Disabling Windows Firewall: A Comprehensive Guide](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-design-4.png)

# Disabling Windows Firewall: A Comprehensive Guide

[![](https://secure.gravatar.com/avatar/9a14f10ff1b1ec7d790d34f5b559e4d3de2d31b172e6ef266dfd8b479174d97b?s=192&d=mm&r=g)June Castillote](https://adamtheautomator.com/author/june/)28 January 202110 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Microsoft Windows Server](/tag/microsoft-windows-server/)[Windows 10](/tag/windows-10/)

Table of Contents

*   [Prerequisites](#h-prerequisites)
*   [For a Non-Domain Environment](#h-for-a-non-domain-environment)
*   [For a Domain Environment](#h-for-a-domain-environment)
*   [Using the GUI](#h-using-the-gui)
*   [Using the Windows Security App](#h-using-the-windows-security-app)
*   [Disable Windows Firewall Using the Windows Defender Firewall Control Panel](#h-disable-windows-firewall-using-the-windows-defender-firewall-control-panel)
*   [Using the Command-Line](#h-using-the-command-line)
*   [Turning off the Windows Firewall with the NETSH Command](#h-turning-off-the-windows-firewall-with-the-netsh-command)
*   [Using the Set-NetFirewallProfile PowerShell Cmdlet](#h-using-the-set-netfirewallprofile-powershell-cmdlet)
*   [Turning off the Windows Firewall Remotely Using PowerShell](#h-turning-off-the-windows-firewall-remotely-using-powershell)
*   [Using Group Policy](#h-using-group-policy)
*   [Creating the GPO](#h-creating-the-gpo)
*   [Deploying the GPO to All Domain Computers](#h-deploying-the-gpo-to-all-domain-computers)
*   [Using The Custom Script Extension to Disable Windows Firewall on Azure Virtual Machines](#h-using-the-custom-script-extension-to-disable-windows-firewall-on-azure-virtual-machines)
*   [Creating the Disable-Windows-Firewall.ps1 Script](#h-creating-the-disable-windows-firewall-ps1-script)
*   [Installing the Custom Script Extension and Uploading the PowerShell Script](#h-installing-the-custom-script-extension-and-uploading-the-powershell-script)
*   [Summary](#h-summary)
*   [Further Reading](#h-further-reading)

_“Why would you disable or turn off the Windows Firewall?”_

Not a reader? Watch this related video tutorial!

**_Not seeing the video? Make sure your ad blocker is disabled._**

There are many reasons one would disable the firewall in Windows. Not every reason is sound, of course, but there are legitimate ones.

In this article, you will learn the many ways to disable the Windows firewall. Whether you’re in a single-machine setup, home network, or a corporate environment, this article is for you.

You’re going to learn how to turn off the software firewall in Windows in just about every way possible!

*   Using the Windows firewall management console
*   The command-line (cmd.exe)
*   PowerShell
*   [Group policy](https://adamtheautomator.com/what-is-group-policy/ "Group policy")
*   Even Azure Custom Script extension if you’re on an Azure virtual machines

Let’s dig in!

## Prerequisites

Since this article is a how-to, there are some requirements that you need to follow along with the instructions. Some examples involve domain and non-domain environment.

### For a Non-Domain Environment

*   One or more computers that are running on Windows 10. You can do the examples here in just one computer, but some instructions are specific to remoting.
*   And you must have administrator permissions on those Windows 10 computers.

### For a Domain Environment

*   A Windows 2019 server that is also a domain controller. A Windows 2016 server should also work.
*   One or more Windows 10 computers in the same network and joined to the domain.

## Using the GUI

Probably the quickest way to disable the firewall is using the included GUI tools in Windows. Using the GUI is probably the easiest way to turn off the Windows firewall for home users.

### Using the Windows Security App

The first GUI tool to manage is the Windows Security App. The Windows Security app is available on Windows 10, version 1703, and later.

1.  Launch the Windows Security app by clicking on the Start button, and start typing _Windows Security_. The search result would show the Windows Security app, click on **Open**.

![Launching the Windows Security App in Windows 10](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-55.png)

Launching the Windows Security App in Windows 10

2\. You will see different menu items in the Windows Security app home. Look for **Firewall & network protection** and click to open it.

![The Windows Security App home](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-56-1024x513.png)

The Windows Security App home

3\. On the **Firewall & network protection** page, you should see the different network profiles listed. These network profiles are _Domain Network_, _Private Network_, and _Public Network_. You can turn off the firewall for each of these network connection locations individually. In this example, you need to select the **Private Network** profile.

![List of Network Profiles in the Windows Security app](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-57.png)

List of Network Profiles in the Windows Security app

4\. In this example, the Private Network profile is selected. Once inside the Private Network settings, click on the switch to turn off the Windows Defender Firewall.

![Disable Windows Firewall for the network profile](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-58.png)

[Disable Windows Firewall](https://adamtheautomator.com/disable-windows-firewall/ "Disable Windows Firewall") for the network profile

Repeat the same steps for the other network profiles if you prefer.

### Disable Windows Firewall Using the Windows Defender Firewall Control Panel

Another GUI tool is the _Windows Defender Firewall Control Panel_. As opposed to the Windows Security App which has the modern interface of a Windows 10 App, the _Windows Defender Firewall Control Panel_ sports the same look of classic control panel items.

Below are several ways to launch the _Windows Defender Firewall Control Panel_

Method 1: Go to C**ontrol Panel —> System and Security —> Windows Defender Firewall**.

![Open Windows Defender Firewall from Control Panel](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-59.png)

Open Windows Defender Firewall from Control Panel

Method 2: Open the Start menu and type _windows defender firewall_. Click on the **Windows Defender Firewall** link.

![Open Windows Defender Firewall the Start Menu Search](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-60.png)

Open Windows Defender Firewall the Start Menu Search

Method 3: Open the Run dialog box and type in the command `control firewall.cpl` and click **OK.**

![Open Windows Defender Firewall the Run Dialog](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-61.png)

Open Windows Defender Firewall the Run Dialog

In the **Windows Defender Firewall Control Panel**, you should see a familiar list of network profiles; _Domain networks, Private networks,_ and _Guest or public networks_. On the left-hand side, click on the **Turn Windows Defender on or off** link.

![The network profiles list in Windows Defender Firewall](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-62.png)

The network profiles list in Windows Defender Firewall

On the Customize Settings page, you’ll have the option to disable the Windows firewall for each network profile. In the example below, the Windows Firewall is turned off on all network profiles.

![Disable Windows Firewall on each network profile](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-63.png)

Disable Windows Firewall on each network profile

## Using the Command-Line

As you may already know, most, if not all, of the GUI operations in Windows, have a command-line counterpart. Using the command-line is at times quicker, as opposed to going to different windows location when using the GUI options.

Additionally, the command-line options enable users to script or automate the task.

### Turning off the Windows Firewall with the NETSH Command

An old but useful handy utility called `netsh` s ready for use to manage network configurations on a computer, or in this case, to disable the Windows Firewall.

Using `netsh advfirewall set` c you can disable the Windows Firewall individually on each location or all network profiles.

*   `netsh advfirewall set currentprofile state off` – this command will disable the firewall for the current network profile that is active or connected. For example, suppose the currently active network profile is Domain network. In that case, this command will the Firewall for that network profile.
*   `netsh advfirewall set domainprofile state off` – disables on the _Domain network_ profile only.
*   `netsh advfirewall set privateprofile state off` – disables on the _Private network_ profile only.
*   `netsh advfirewall set publicprofile state off` – this command will disable on the _Public network_ profile only.
*   `netsh advfirewall set allprofiles state off` – this command will disable on all network profiles at once.

The demonstration below shows each of the commands above in action.

![Disable Windows Firewall using netsh](https://adamtheautomator.com/wp-content/uploads/2021/05/netsh-advfirewall-min.gif)

Disable Windows Firewall using netsh

> _Learn more about [Netsh Command Syntax, Contexts, and Formatting](https://docs.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts)_

### Using the `Set-NetFirewallProfile` PowerShell Cmdlet

The _[NetSecurity](https://docs.microsoft.com/en-us/powershell/module/netsecurity/?view=windowsserver2022-ps&viewFallbackFrom=win10-ps)_ PowerShell module is built-in to Windows 10, as well as Windows Server 2012, and above. This NetSecurity [PowerShell module](https://adamtheautomator.com/powershell-modules/ "PowerShell module") contains cmdlets related to network and network security configuration. One of these cmdlets is the `Set-NetFirewallProfile` which can be used to disable Windows Firewall.

The `Set-NetFirewallProfile` syntax is shown below.

```powershell
# Disable Windows Firewall for each specified network profile
Set-NetFirewallProfile -Profile <PROFILE NAME> -Enabled False

# Disable Windows Firewall for ALL network profiles
Set-NetFirewallProfile -All -Enabled False
```

The command below will turn off the firewall on the _Public_, _Private_, and _Domain_ network profiles.

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

The demonstration below shows how the `Set-NetFirewallProfile` works to disable Windows Firewall using the command above.

![Disable Windows Firewall on selected network profiles](https://adamtheautomator.com/wp-content/uploads/2020/08/NetSecurity-FirewallProfile.gif)

Disable Windows Firewall on selected network profiles

Without specifying any profile names, the example below shows how to disable Windows Firewall on all network profiles by using the `-All` parameter switch.

![Disable Windows Firewall on all network profiles](https://adamtheautomator.com/wp-content/uploads/2020/08/NetSecurity-DisableAll.gif)

Disable Windows Firewall on all network profiles

### Turning off the Windows Firewall Remotely Using PowerShell

When you need to disable the firewall on many computers, it would be inefficient to manually login to each computer and run the commands. Especially in a network environment, you could disable remotely using PowerShell.

> _Note: This procedure requires that WinRM is already enabled on the target computer. In most cases, WinRM is already set up for domain-joined computers for remote management purposes._
> 
> _Learn more: [How to enable Windows Remote Shell](https://docs.microsoft.com/en-US/troubleshoot/windows-server/remote/how-to-enable-windows-remote-shell)_

If you plan to disable Windows Firewall on one remote computer at a time, you can use the `Enter-PsSession` cmdlet to issue the commands to the remote computer.

In the example below, the command will be issued from the server named _dc_, and the remote computer name is _desktop1._ The command that will be used is shown below.

```powershell
Enter-PsSession -ComputerName desktop1
Set-NetFirewallProfile -All -Enabled False
```

Running the code above in PowerShell would result in a similar output, as the demo below.

![Disable Windows Firewall remotely using PowerShell (Enter-PsSession)](https://adamtheautomator.com/wp-content/uploads/2020/08/enablefw-remote-ps.gif)

Disable Windows Firewall remotely using PowerShell (Enter-PsSession)

The above process is good only if you are working on a few remote computers. But, if you have a bulk of computers where you need to disable it, you will need an approach that is more adapted to scripting. For that, you can use the [`Invoke-Command`](https://adamtheautomator.com/invoke-command/ "Invoke-Command") cmdlet.

```powershell
$computers = @('desktop1')
$computers | ForEach-Object {
	Invoke-Command -ComputerName $_ {
		Set-NetFirewallProfile -All -Enabled False
	}
}
```

As you can see from the above code, the name of the remote computers is stored in the `$computers` variable as an array. Then, PowerShell loops through each of the remote computers to run the `Invoke-Command` cmdlet and issue the `Set-NetFirewallProfile -All -Enabled False` command. Refer to the demo below for the expected result.

![Disable Windows Firewall remotely using PowerShell (Invoke-Command)](https://adamtheautomator.com/wp-content/uploads/2020/08/enablefw-invoke-ps.gif)

Disable Windows Firewall remotely using PowerShell (Invoke-Command)

## Using Group Policy

By deploying a GPO, systems admins can turn off the Windows Firewall for selected or all computers in the domain. Once deployed, disabling Windows Firewall will be automated as the configuration enforces it via policy on all computers that are in scope.

### Creating the GPO

To create a GPO, you need to launch the **Group Policy Management** Console on the server. To do so, run `gpmc.msc` command in the Run dialog.

![gpmc.msc command in the Run dialog](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-64.png)

`gpmc.msc` command in the Run dialog

In the **Group Policy Management** console, expand the forest and then select the domain where you will create the GPO. In the image below, the GPO is created in the [_xyz.int_](http://xyz.int) domain. Right-click on the domain and click **Create a GPO in this domain, and Link it here…**

![Create a GPO in this domain, and Link it here...](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-67.png)

**Create a GPO in this domain, and Link it here…**

The **New GPO** dialog box will pop up. Type in _Disable Windows Firewall_ in the **Name** box, then click on the **OK** button.

![Enter the name of the new GPO](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-68.png)

Enter the name of the new GPO

Next, right-click on the new GPO and click **Edit**. The GPO will open in the **Group Policy Management Editor**. Then, expand these folders **Computer Configuration —> Policies —> Administrative Templates —> Network —> Network Connections —> Windows Defender —> Firewall —> Domain Profile.**

In the settings list on the right pane, double-click on **Windows Defender Firewall: Protect all network connections** to open its properties.

![Group Policy Management Editor](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-69.png)

Group Policy Management Editor

Once the settings property is open, change the value by selecting **Disabled**, then click **OK**.

![Set Windows Firewall setting to Disabled](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-70.png)

Set Windows Firewall setting to Disabled

Repeat and apply the same option to the **Standard Profile** settings. Then, you can now exit the **Group Policy Management Editor** window.

### Deploying the GPO to All Domain Computers

Now that you’ve created the GPO, you now need to deploy the GPO to the domain computers.

To apply the GPO, in the **Group Policy Management**, select the **Disable Windows Firewall** GPO. Then, in the **Scope** tab, click on **Add** button under the **Security Filtering** section.

![Add Security Filtering](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-71.png)

Add Security Filtering

In the **Select User, Computer, or Group** dialog box, search for _Domain Computers_ and click **OK**. Doing so will ensure that the GPO is applied to all computers that are members of the _Domain Computers_ group.

![Search and choose Domain Computers](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-73.png)

Search and choose Domain Computers

And that’s it! The next time that the client computers get the policy update, the firewall will be turned off on those computers.

Now that the GPO has been created and deployed, you can test whether the GPO is working by forcing a policy update. Run the `[gpupdate](https://adamtheautomator.com/gpupdate/ "gpupdate") /force` on the client computer to test the policy update.

![Force update the policy](https://adamtheautomator.com/wp-content/uploads/2020/08/fw-disable-gpo.gif)

Force update the policy

As you can see from the result above, as soon as the policy was applied on the client computer. The configuration to disable Windows Firewall was applied. Additionally, there is an information box saying that the settings are managed by the system administrator.

![Information box](https://adamtheautomator.com/wp-content/uploads/2020/08/Untitled-74.png)

Information box

> _Note: The automatic update interval for Group Policy is every 90 minutes for regular users and computers. Additionally, Group Policy is also updated when the computer is started, or a user logs in._

## Using The Custom Script Extension to Disable Windows Firewall on Azure Virtual Machines

If you have an Azure VM that you suddenly cannot access anymore because the Windows Firewall is blocking traffic, including RDP. Maybe you made changes to the Windows Firewall and inadvertently locked yourself out!

If you’ve tried all the ways previously discussed in this article and still no luck, there’s still hope. You can disable Windows Firewall inside an Azure VM’s guest OS by utilizing the _[Azure Custom Script Extension](https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/custom-script-windows)._ The _Azure Custom Script Extension_ works executing a script hosted in Azure Storage or GitHub against your Azure VM’s guest OS.

The high-level steps involve:

*   Create a PowerShell script (\*.PS1) containing commands to disable Windows Firewall.
*   Install the Custom Script Extension on your Azure VM using the _[Azure Portal](https://portal.azure.com/#home)_.
    *   Upload the PowerShell script to Azure Storage.
    *   The script will run automatically on the Azure VM’s guest OS one time only.

In this example, the test VM is named _devmachine1_ with the Windows Firewall in an _enabled_ state.

> _Note: Before you proceed, make sure that you have the proper [Azure RBAC](https://docs.microsoft.com/en-us/azure/role-based-access-control/overview) role in your account._

### Creating the _`Disable-Windows-Firewall.ps1`_ Script

In the previous sections, you’ve learned which commands are available to disable Windows Firewall. In this example, the `netsh` utility will be used.

Using the code or text editor of your choice, create a new file with name _Disable-Windows-Firewall.ps1._ Edit the script and add this line of code: `netsh advfirewall set allprofiles state off`. Save the script when done. Below is how to quickly do it in PowerShell.

```powershell
'netsh advfirewall set allprofiles state off' | Out-File .\\Disable-Windows-Firewall.ps1
```

### Installing the Custom Script Extension and Uploading the PowerShell Script

Now that your script is ready, the next step is to install the Custom Script Extension and upload the script to an Azure Storage location. And once the extension is installed, the script will automatically run against the Azure VM.

*   First, log in to the _[Azure Portal](https://portal.azure.com)_ and locate the Azure VM resource and open it. In this example, the Azure VM name is _devmachine1_. Then, go to the **Extensions** blade and click the **Add** button.
*   In the **New Resource** page, locate and click on **Custom Script Extension**. Then, click on **Create**. In the **Install extension** page, click the **Browse** button next to the **Script file (required)** box.
*   Select the **Storage Account** from the list. In this example, the storage account name is _storagexyz01._ Then a list of containers will be shown; click on the container where the script file will be uploaded. In this example, the container name is _cont1_.

> _Note: If you do not have an Azure storage account or container yet and need to create one, visit [Create an Azure Storage account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-create?tabs=azure-portal) to learn how._

*   After selecting the container, click on **Upload** and browse for the _disable-windows-firewall.ps1 file_ that you created on your computer. Once you’ve selected the file, click the **Upload** button.
*   You should see that _disable-windows-firewall.ps1_ file is now available inside the container. Click on _disable-windows-firewall.ps1_ from the list and click on **Select.** You will be brought back to the **Install extension** page, and you must click on **OK** to finally begin installing the extension.

At this point, you only need to wait for the extension to be deployed, which will also automatically execute the script that you uploaded. Refer to the demonstration below to see the whole process in action.

![Disable Windows Firewall in Azure VM using the Custom Script Extension](https://adamtheautomator.com/wp-content/uploads/2020/08/disable-fw-customextn.gif)

Disable Windows Firewall in Azure VM using the Custom Script Extension

## Summary

In this article, you’ve learned how to disable Windows Firewall using the built-in, available GUI tools in Windows. You’re also learned how to use commands using `netsh` and PowerShell to disable Windows Firewall locally or remotely.

Also, you’ve learned how to create and deploy a Group Policy Object that would disable Windows Firewall for domain computers. Lastly, you’ve learned how to use the Azure Custom Script Extension to disable Windows Firewall in Azure VM’s guest OS.

There surely are many different ways to disable Windows Firewall. Some of those methods were covered in this article. However, there are still other methods that you could explore on your own, such as using _[PsExec](https://docs.microsoft.com/en-us/sysinternals/downloads/psexec)_ to remotely disable it.

## Further Reading

*   _[**How to Generate an Azure SAS Token to Access Storage Accounts**](https://adamtheautomator.com/azure-sas-token/)_
*   _[**How To Manage Files Between Local And Azure Storage With AZCopy**](https://adamtheautomator.com/azcopy/)_
*   _[**Using the Azure custom script extension Windows**](https://adamtheautomator.com/azure-run-script-on-vm/)_

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fdisable-windows-firewall%2F&text=Disabling%20Windows%20Firewall%3A%20A%20Comprehensive%20Guide)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fdisable-windows-firewall%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fdisable-windows-firewall%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2024/01/OpenSSL-on-Windows-10.jpg)

### [Master OpenSSL on Windows 10: A Guide to Powerful Security](/openssl-windows-10/)

Master OpenSSL on Windows 10 with PowerShell, from installation to certificate signing requests and conversions.

![](https://adamtheautomator.com/wp-content/uploads/2020/07/bitlocker-recovery-key.jpg)

### [Save & Recover Bitlocker Recovery Keys: A Complete Guide](/bitlocker-recovery-key/)

Learn how to save and recover Bitlocker recovery keys from files, USB drives, AD, Azure AD, and more in this tutorial.

![](https://adamtheautomator.com/wp-content/uploads/2021/05/How-to-Partition-and-Erase-Windows-Volumes-with-Diskpartx.jpg)

### [Mastering Diskpart : Erase and Partition Volumes with Ease](/diskpart/)

Learn how to create partitions, create volumes, delete volumes and partitions and manage unallocated space with the Windows Diskpart utility.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
