Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › firewall backup

Microsoft Defender Firewall in Windows 11: Backup, Restore, and Recovery Steps

By Freedom251 Team · · 11 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use an elevated Windows Terminal or Command Prompt to save the complete Windows 11 firewall policy with netsh advfirewall export, then restore it with netsh advfirewall import. Create a readable companion file with netsh advfirewall dump so you can inspect the configuration or use the generated script for recovery. Before resetting the firewall, export the existing policy; netsh advfirewall reset otherwise returns local settings to their defaults. These operations cover Domain, Private, and Public profiles in the policy store you target, but Active Directory Group Policy or mobile-device management can reapply different settings. Keep the Windows Defender Firewall service running: Microsoft does not support stopping the service as a troubleshooting method.

What does a Windows 11 firewall backup contain?

A whole-policy export captures the current Microsoft Defender Firewall policy in a Windows Firewall Policy file with the .wfw extension. It is intended for restoring the policy store rather than for reading individual rules in a text editor. The policy includes firewall configuration across Windows 11’s Domain, Private, and Public profiles, including inbound and outbound rule settings and connection-security policy held in that store.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The export represents the policy that is active on the computer when you run the command. That distinction matters on managed PCs: an organization can deliver settings through Active Directory Group Policy or mobile/device management. A local export cannot necessarily replace those centrally managed settings, and a later policy refresh can make the computer look different from the imported file.

Whole-policy export versus a readable dump

The .wfw file is the primary backup for a complete restore. A dump is a text representation of commands that recreate the current configuration. Keep both when you need an audit trail or want to see what the policy contained without opening a binary policy file.

#1 Best Overall
Sale
LAPGEAR Home Office Pro Lap Desk - Black Carbon, Fits 15.6” Laptops | Built-In Mouse Pad & Phone Slot, Wide Cushioned Wrist Rest, Dual-Bolster Microbead Cushion, Carry Handle
  • Spacious Design: Measuring 21.1" wide and 14.1" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy ergonomic support with the integrated cushioned wrist rest.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a sleek black carbon color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.8 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.
Artifact Command Best use Important limitation
Windows Firewall Policy file netsh advfirewall export "C:Backupsfirewall_backup.wfw" Primary whole-policy backup and import Not intended for manual text editing; reflects the policy store available at export time
Readable configuration dump netsh advfirewall dump > "C:Backupsfirewall_dump.txt" Human review, documentation, and script-based recovery It is a command script, not a replacement for the policy export when you need a complete binary backup
Selective rule copy PowerShell Copy-NetFirewallRule Move one rule and its associated filters instead of replacing the whole policy Requires identifying the correct rule and destination policy store

What do I need before backing up the firewall?

You need an administrator account, an elevated shell, and a destination that the administrator can write to. The commands do not require you to stop the firewall service or disable any profile.

  • Administrator access: Sign in with an account that can run elevated commands.
  • Windows 11: Open Windows Terminal (Admin) or Command Prompt (Admin) from the Win+X menu or Start search.
  • Backup directory: Create a folder such as C:Backups before redirecting output to it.
  • Policy scope: Determine whether rules are local, delivered by Group Policy, or managed through an organization’s device-management system.
  • Safe storage: Treat the files as configuration backups. After testing them, copy them to protected storage rather than leaving the only copy on the Windows system being repaired.

To create the directory from an elevated PowerShell prompt, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
New-Item -ItemType Directory -Path "C:Backups" -Force

From an elevated Command Prompt, the equivalent is:

mkdir C:Backups

If the folder already exists, the PowerShell command leaves it in place; Command Prompt may report that the directory already exists, which is harmless.

How do I back up all Windows 11 Firewall rules?

Run netsh advfirewall export in an elevated shell. Microsoft documents this command as exporting the current firewall policy settings to a specified file.

  1. Open Windows Terminal (Admin) or Command Prompt (Admin).
  2. Create the backup folder if necessary.
  3. Export the active policy:
netsh advfirewall export "C:Backupsfirewall_backup.wfw"
  1. Wait for netsh to report completion, then confirm that C:Backupsfirewall_backup.wfw exists.
  2. Copy the file to protected storage if the backup is intended for disaster recovery or a Windows reset.

Use a unique filename when you are keeping several points in time, for example firewall_2026-10-26_before-app-change.wfw. Do not overwrite the only known-good export until the replacement has been checked.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I make a readable record of the firewall configuration?

Redirect the output of netsh advfirewall dump to a text file. Microsoft describes dump as displaying a configuration script that can be used to restore the current configuration.

Rank #2
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
netsh advfirewall dump > "C:Backupsfirewall_dump.txt"

Open the resulting text file in Notepad or another plain-text viewer to document profile state, rules, and related settings. Because the redirection operator overwrites an existing file, use a dated filename or copy the previous dump before running the command again.

The dump is useful when you need to answer questions such as which executable a rule allows or whether a profile was enabled. It should remain a companion record: use the .wfw export for the normal whole-policy import, and keep the dump for human review or script-based recovery when appropriate.

How do I restore a saved Windows Firewall policy?

Import the saved .wfw file from an elevated prompt. The import loads the saved firewall policy into the current policy store and can replace local settings that were changed after the export.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Close or pause troubleshooting work that might change firewall rules while the import runs.
  2. Open Windows Terminal (Admin) or Command Prompt (Admin).
  3. Run:
netsh advfirewall import "C:Backupsfirewall_backup.wfw"
  1. Wait for the completion message.
  2. Review the resulting profiles and rules before testing the affected application or connection.

An import does not guarantee that the final effective policy will remain identical on a managed computer. Group Policy or device-management policy can be reapplied after the import, and those centrally delivered rules may take precedence over local expectations. If the imported rules appear briefly and then change, investigate policy management rather than repeatedly importing the file.

How do I verify that the restore worked?

Check both the profile state and the individual rules. Use the command line for a quick inventory, then use the graphical console when you need to inspect rule properties and policy sources.

netsh advfirewall show allprofiles state

This reports the state of the Domain, Private, and Public profiles. To list the firewall rules currently visible to netsh, run:

netsh advfirewall firewall show rule name=all

For a graphical review, open Windows Security > Firewall & network protection > Advanced settings. The Advanced Security console exposes inbound rules, outbound rules, and connection-security rules. Confirm the profile assignment, action (allow or block), enabled state, program or service scope, protocol, ports, and remote or local address restrictions for any rule that matters to your recovery.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Yilador Webcam Cover 3 Pack, 0.03 inch Ultra Thin Laptop Camera Cover Slide | Camera Blocker Slider for iPhone iPad MacBook Pro Computer iMac Cell Phone PC Laptop Accessories, Great for Privacy, Black
  • Note: Not suitable for MacBooks released after 2023 or devices with a protruding front camera; Not applicable to full-screen or notch-style tempered glass screen protectors; Do not use on the rear camera of the phone.
  • 💻 Why Do You Need a Webcam Cover Slide? — Safeguard your privacy by covering your webcam with our reliable webcam cover when not in use. Don't let anyone secretly watch you. Stay protected!
  • ✅ Thin & Stylish — Enhance your laptop's functionality and aesthetics with our 0.027" ultra-thin webcam covers. Seamlessly close your laptop while adding a touch of sophistication.
  • ✅ Fits Most Devices — Compatible with laptops, phones, tablets, desktops! Keep your privacy intact on Ap/ple, Mac/Book, iPh/one, iP/ad, H/P, L/novo, De/ll, Ac/er, As/us, Sa/msung devices.
  • ✅ 365 Days Protection — Our upgraded 3.0 adhesive ensures a strong hold that won't damage your equipment. Experience reliable, long-term privacy protection day in and day out.
  • Test the application or service that prompted the restore.
  • Check more than one network profile if the device moves between domain, private, and public networks.
  • Look for duplicate or superseding rules if behavior differs from the saved configuration.
  • If a rule is missing or changes again, check whether it is supplied by Group Policy or device management.

How do I reset the firewall safely before restoring it?

Export the current policy before resetting. The reset command returns local firewall policy to defaults, so it is a recovery action rather than a harmless test.

netsh advfirewall reset export "C:Backupsbefore_reset.wfw"

This form saves the current policy while performing the reset. If you already made a separate export, you can reset with:

netsh advfirewall reset

After the reset, verify the default profile state and rules. If the reset was only a diagnostic step, restore the known-good policy with:

netsh advfirewall import "C:Backupsbefore_reset.wfw"

What a reset does to managed policy

Microsoft notes that organization-applied firewall policies are reapplied after a reset. The netsh reference also states that resetting a Group Policy object returns its settings to NotConfigured and deletes firewall and connection-security rules in that policy store. Do not use a reset as a way to remove corporate controls; the management system can recreate them, and changing a domain policy may affect other users.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Should I stop the Windows Defender Firewall service while troubleshooting?

No. Microsoft says stopping the Windows Defender Firewall service, MpsSvc, is unsupported and can cause problems with Start, application installation and updates, activation, and compatibility.

If a test genuinely requires the firewall to be temporarily disabled, change the profile state while leaving the service running. In an elevated prompt, the profile-state commands are:

netsh advfirewall set allprofiles state off
netsh advfirewall set allprofiles state on

Use the shortest possible test window, record the original state, and turn the profiles back on immediately. A profile-state change is different from stopping MpsSvc: the service remains available to Windows and management tools.

Rank #4
AboveTEK Portable Laptop Lap Desk w/Retractable Left/Right Mouse Pad Tray, Non-Slip Heat Shield Tablet Notebook Computer Stand Table w/Sturdy Stable Work Surface for Bed Sofa Couch or Travel
  • Anti-Slip Surface - Transform your laptop into a mobile workstation with the AboveTEK portable laptop lap desk. The anti-slip surface provides a strong grip for laptops up to 15.6 inches(Diagonal), while the double rubber strip on the bottom ensures a stable display or typing experience on your lap, couch, or bed.
  • Retractable Mouse Pad - Retractable laptop mouse pad extends on both directions for the left/right handed with elevation along the edges for stopping mouse from falling off. The size of laptop tray is 14" X 9.7" and the size of mouse pad is 7.4" X 6.1".
  • Effective Heat Shield - The effective heat shield made of sturdy and thick material protects your laptop from overheating. Prioritizes your comfort and safety, an ideal lap pad or board for working anywhere.
  • EASY to Carry and Store - With an ergonomic and simplistic design, the lap desk is portable to store in a backpack. Only 15" in size, 2.2 lb of weight and with slim 0.6 inch thickness, it is ready to be easily carried around.
  • Widely Applicable - The smooth platform accommodates laptops and tablets up to 15.6 inches(Diagonal), making it a versatile accessory and one of the best gifts for mom, dad, students and professionals. Perfect for use as a laptop bed tray or tablet holder anywhere at home, library, or park.

How do Domain, Private, and Public profiles affect a backup?

Windows Firewall maintains separate Domain, Private, and Public profiles. A rule can be enabled for one profile and inactive for another, so a restore can appear successful while the expected behavior occurs only on a different network classification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Domain: Used when Windows recognizes the device on its organization domain.
  • Private: Used for a trusted network you have classified as private.
  • Public: Used for untrusted or unknown networks, where restrictive rules are often expected.

Export and import the policy as a whole, then inspect each profile with netsh advfirewall show allprofiles state. When diagnosing an application, identify the profile active at the time of the failure instead of assuming that a rule enabled for Private also applies to Public.

How do I move only one firewall rule instead of restoring everything?

Use PowerShell’s Copy-NetFirewallRule when a whole-policy import would overwrite unrelated changes. The cmdlet copies a complete rule and its associated filters to the same or another policy store.

First locate the rule and its internal name:

$rule = Get-NetFirewallRule -DisplayName "Allow inbound HTTPS"
$rule | Select-Object Name, DisplayName, Enabled, Direction, Action, Profile

Then copy it to the destination store:

Copy-NetFirewallRule -Name $rule.Name -PolicyStore "ActiveStore" -NewPolicyStore "PersistentStore"

Replace the example display name with the rule you actually intend to migrate. Use the exact internal Name returned by Get-NetFirewallRule; a display name is not always the identifier accepted by the copy operation. Confirm the destination policy store and inspect the copied rule afterward. Selective copying is useful for one application or port, but it is not a substitute for a complete .wfw backup when you need every profile and rule.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What should I do when backup or restore fails?

“Access is denied” or the command cannot open the file

Reopen Terminal or Command Prompt with Run as administrator. Check that the destination folder exists and that the account can write to it. A protected, disconnected, or read-only drive can also prevent creation of the export; test with a local folder such as C:Backups first.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The export command completes but no file appears

Confirm the exact path and filename, including the .wfw extension. In PowerShell, quote paths containing spaces. Then list the directory and check the file’s modified time before copying it elsewhere.

The import completes but the old behavior remains

Run the profile and rule checks again, then inspect Advanced settings. The active network may use a different profile, or Group Policy or mobile/device management may have reapplied its own policy. A local import cannot permanently override a centrally managed rule.

Best Value
Sale
LAPGEAR Home Office Lap Desk – Pink, Fits 15.6” Laptops | Built-In Mouse Pad & Phone Slot, Integrated Device Ledge, Dual-Bolster Microbead Cushion, Carry Handle
  • Spacious Design: Measuring 21.1" wide and 12" deep, our lap desk comfortably fits most laptops up to 15.6". Extra room for accessories ensures convenience.
  • Enhanced Functionality: Packed with handy features, including a 5x9" precision tracking mouse pad and a built-in phone slot for seamless work or video calls. Plus, enjoy laptop support with the integrated device ledge.
  • Cool Comfort: Enjoy a stable surface with our lap desk's dual bolster cushion, designed for comfort and airflow, keeping your lap cool during extended use.
  • Durable Surface: Work with confidence on our lap desk's solid surface, featuring a blush pink color, ensuring optimal air circulation to prevent your laptop from overheating.
  • On-the-Go Convenience: With an integrated handle and lightweight design (2.14 lbs), our lap desk is portable for travel or moving around the house, offering flexibility in any space.

The text dump is confusing or does not behave like a backup

A dump is a sequence of netsh commands, not a graphical report and not the same file format as a .wfw export. Keep it unmodified for reference. If you use it as a recovery script, run it from an elevated prompt with netsh’s script-file support and review the resulting policy afterward.

A reset removed rules I still need

Import the pre-reset export you created with reset export or the earlier whole-policy export. If the rules return and then disappear, identify the policy-management source before attempting another reset; an organization’s policy may intentionally remove or replace local rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How should I maintain firewall backups?

Create a new export before major application installations, security-product changes, policy troubleshooting, or Windows recovery work. Keep a dated .wfw file and, when useful, a matching dump with the same date and change description. Retain at least one known-good copy that predates the problem and store it somewhere separate from the computer being repaired.

  • Record whether the device was connected to a domain, private, or public network when you made the backup.
  • Note whether the computer is managed by Active Directory or device-management software.
  • Protect backup files because they reveal the computer’s permitted programs, ports, addresses, and security posture.
  • Test a restore procedure on a noncritical device or during a planned maintenance window before relying on it for an outage.
  • After importing, verify both inbound and outbound rules; checking only the rule that triggered the incident can miss an unintended change elsewhere.

Which recovery method should I choose?

Situation Recommended method Why
You want a complete snapshot before changing settings netsh advfirewall export, optionally plus dump Preserves the whole policy and provides a readable record
You need to return local policy to defaults netsh advfirewall reset export Saves the existing policy before the reset removes local customizations
You need to restore the saved snapshot netsh advfirewall import Loads the saved policy into the current policy store
Only one application rule is wrong Copy-NetFirewallRule Moves a rule and its filters without replacing unrelated policy
The computer is organization-managed Check Group Policy or device-management source first Centrally delivered settings can override or reapply after local changes

What is the safest complete workflow?

  1. Identify the management source and active network profile.
  2. Open an elevated Windows Terminal or Command Prompt.
  3. Create a protected backup directory.
  4. Export the complete policy to a dated .wfw file.
  5. Create a matching text dump for review.
  6. Make the firewall change, reset, or Windows recovery operation.
  7. Import the saved policy only when a whole-policy rollback is appropriate.
  8. Inspect all profiles, inbound and outbound rules, and connection-security rules.
  9. Test the affected application or service.
  10. Check for Group Policy or device-management changes if the result does not persist.

Frequently Asked Questions

Can I keep several firewall backups on one computer?

Yes. Use dated filenames that identify the event, such as a pre-update or pre-reset snapshot, and avoid overwriting the only known-good file. Copy an additional version to protected storage because a local disk failure or Windows recovery operation can remove every file on that disk.

Is it safe to email a .wfw file to a technician?

Treat it as sensitive configuration data rather than an ordinary document. It can disclose permitted applications, ports, addresses, and other security-policy details, so use an approved protected transfer method and remove access when the repair is complete.

Why can a rule work on my home network but not on public Wi-Fi?

The connection may be using different firewall profiles. Domain, Private, and Public profiles can have different enabled rules and states; identify the active profile and verify that the rule is assigned to it before changing the policy.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use the text dump as a change log?

Yes, saving dated dumps lets you compare the command-level configuration before and after a change. Keep the original files unedited so they remain trustworthy records, and use the binary export when you need the normal whole-policy restore path.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

firewall backupfirewall restoreMicrosoft Defender FirewallnetshWindows 11Windows Security

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.