Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to restore Microsoft Defender Firewall defaults in Windows

Reset local firewall rules through Windows Security, Advanced Security, PowerShell, or Command Prompt, with preparation and checks for affected apps.

Table of Contents

Restoring Microsoft Defender Firewall defaults resets local firewall settings and rules. It does not reinstall Windows Security, reset antivirus settings, or repair every connection problem. Use it when an unwanted firewall configuration is the likely cause and you can restore any required custom rules.

Before you reset

Custom exceptions may be removed, which can interrupt remote access, sharing, or applications. On a work or school PC, contact the administrator; managed policies can reapply. Avoid doing this over a remote-only connection without a recovery plan.

To keep a copy, open wf.msc and use Action > Export Policy, saving the file somewhere you can find later. Exporting does not itself reset the firewall. Review Windows Security basics if you are unsure which component reports the problem.

Method 1: restore firewall defaults through Windows Security

Step 1:

You open the Windows Security application on your computer, then click Firewall & network protection .

How to reset Windows Security settings on Windows Picture 1

Step 2:

Next, look to the side, the user clicks Restore firewall to default to perform.

How to reset Windows Security settings on Windows Picture 2

In the confirmation page, read the warning, select Restore defaults, and confirm only when ready to remove the custom firewall configuration.

How to reset Windows Security settings on Windows Picture 3

Method 2: restore the default firewall policy

Step 1:

You also open the Windows Security application on your computer and click on Firewall & network protection. Continue to click on Advanced settings .

How to reset Windows Security settings on Windows Picture 4

Step 2:

Users right-click on Windows Defender Firewall with Advanced Security on Local Computer and select Restore Default Policy.

How to reset Windows Security settings on Windows Picture 5

Read the warning and select Yes to restore the firewall policy. This is an alternative to Method 1, not an additional required step.

How to reset Windows Security settings on Windows Picture 6

Method 3: restore local firewall defaults with PowerShell

Step 1:

Type PowerShell in the search bar and click Run as administrator to open PowerShell with Admin rights.

How to reset Windows Security settings on Windows Picture 7

Step 2:

Display new interface, user enter command below to execute.

(New-Object -ComObject HNetCfg.FwPolicy2).RestoreLocalFirewallDefaults()

How to reset Windows Security settings on Windows Picture 8

This command calls the local firewall-policy reset method. It does not reset all Windows Security components. Use only one reset method, then verify the result.

Method 4: reset the firewall with Command Prompt

Step 1:

Type Command Prompt in the search bar and select Run as administrator to open it.

How to reset Windows Security settings on Windows Picture 9

Step 2:

You enter the command below into the interface then press Enter to execute the command.

netsh advfirewall reset

How to reset Windows Security settings on Windows Picture 10

Verify and retest

Return to Firewall & network protection and confirm the firewall is enabled for your active profile. Test the affected application and recreate only the specific rules you understand and need. Keep public networks classified as Public.

If the problem remains, do not keep resetting the firewall or leave it disabled. Follow a structured troubleshooting process. A broken Windows Security app or antivirus issue requires a different diagnosis.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.