Backup and Restore Backup and Restore Microsoft Defender Firewall Settings and Rules in Windows 11


Microsoft_Defender_Firewall_banner.webp

This tutorial will show you how to backup (export) and restore (import) Microsoft Defender Firewall settings and rules in Windows 10 and Windows 11.

Microsoft Defender Firewall in Windows helps safeguard your device by filtering network traffic and blocking unauthorized access. It reduces the risk of network security threats by restricting or allowing traffic based on various properties such as IP addresses, ports, or program paths.

You can backup (export) your Microsoft Defender Firewall settings and rules to make it easy to restore (import) them all at once as needed.

Reference:

You must be signed in as an administrator to backup and restore Microsoft Defender Firewall settings and rules.




Contents

  • Option One: Backup and Restore Microsoft Defender Firewall Settings and Rules in Advanced Security
  • Option Two: Backup (export) Microsoft Defender Firewall Settings and Rules using Command
  • Option Three: Restore (import) Microsoft Defender Firewall Settings and Rules using Command




Option One

Backup and Restore Microsoft Defender Firewall Settings and Rules in Advanced Security


1 Open Windows Security.

2 Click/tap on Firewall & network protection. (see screenshot below)

Microsoft_Defender_Firewall_in_Windows_Security-1.webp

3 Click/tap on the Advanced Settings (wf.msc) link. (see screenshot below)

Microsoft_Defender_Firewall_in_Windows_Security-2.webp

4 If prompted by UAC, click/tap on Yes to approve elevation.

5 Do step 6 (backup) or step 7 (restore) below for what you want.

6 Backup Microsoft Defender Firewall Settings and Rules

A) Perform either action below: (see screenshot below)​
  • Select Windows Defender Firewall with Advanced Security on Local Computer in the left pane, and click/tap on Export Policy in the right "Actions" pane.
  • Select Windows Defender Firewall with Advanced Security on Local Computer in the left pane, click/tap on Action on the toolbar, and click/tap Export Policy.
  • Right click on Windows Defender Firewall with Advanced Security on Local Computer in the left pane, and click/tap Export Policy.
Export_Microsoft_Defender_Firewall_settings-1.webp

B) Navigate to where you want to export the .wfw file, type a file name you want, and click/tap on Save. (see screenshot below)​

Export_Microsoft_Defender_Firewall_settings-2.webp

C) Click/tap on OK. (see screenshot below)​

Export_Microsoft_Defender_Firewall_settings-3.webp

7 Restore Microsoft Defender Firewall Settings and Rules

A) Perform either action below: (see screenshot below)​
  • Select Windows Defender Firewall with Advanced Security on Local Computer in the left pane, and click/tap on Import Policy in the right "Actions" pane.
  • Select Windows Defender Firewall with Advanced Security on Local Computer in the left pane, click/tap on Action on the toolbar, and click/tap Import Policy.
  • Right click on Windows Defender Firewall with Advanced Security on Local Computer in the left pane, and click/tap Import Policy.
Import_Microsoft_Defender_Firewall_settings-1.webp

B) Click/tap on Yes to confirm. (see screenshot below)​

Import_Microsoft_Defender_Firewall_settings-2.webp

C) Navigate to and select the .wfw file you want to import, and click/tap on Open. (see screenshot below)​

Import_Microsoft_Defender_Firewall_settings-3.webp

D) Click/tap on OK (see screenshot below)​

Import_Microsoft_Defender_Firewall_settings-4.webp




Option Two

Backup (export) Microsoft Defender Firewall Settings and Rules using Command


1 Open Windows Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Copy and paste the appropriate command below into Windows Terminal (Admin), and press Enter. (see screenshot below)

Command Prompt
netsh advfirewall export "%userprofile%\Desktop\WindowsFirewallSettingsBackup.wfw"

OR​

Windows PowerShell
netsh advfirewall export "$Env:USERPROFILE\Desktop\WindowsFirewallSettingsBackup.wfw"

3 You will now have a WindowsFirewallSettingsBackup.wfw file saved to your desktop that is the backup of your firewall settings and rules. You can rename and/or move this file to where you like to keep it saved at.

4 When finished, you can close Windows Terminal (Admin) if you like.

Export_Microsoft_Defender_Firewall_settings-command.webp





Option Three

Restore (import) Microsoft Defender Firewall Settings and Rules using Command


1 Open Windows Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Type the command below into Windows Terminal (Admin), and press Enter. (see screenshot below)

netsh advfirewall import "Full path of .wfw file"

Substitute Full path of .wfw file in the command above with the actual full path of the exported .wfw file.

For example: netsh advfirewall import "C:\Users\Brink\Desktop\WindowsFirewallSettingsBackup.wfw"


3 When finished, you can close Windows Terminal (Admin) if you like.

Import_Microsoft_Defender_Firewall_settings-command.webp



That's it,
Shawn Brink


 
Last edited:
Added to Leader Board.
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦26200.8457 ♦♦♦♦♦♦♦25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 5302)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Total Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Keyboard
    Logitech Classic Keybooard 200
    Mouse
    Logitech Optical M-BT96a
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 15 years?
@Brink

Hi Shawn, I'm using Bitdefender Total Security which manages the Windows Defender Firewall settings, does that in any way negate the reasons for backing up the firewall settings?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Homebuilt
    CPU
    Intel Core i9 13900K
    Motherboard
    Asus ProArt Z790 Creator WiFi - Bios 3107
    Memory
    Corsair Dominator Platinum 64gb 5600MT/s DDR5 Dual Channel
    Graphics Card(s)
    Sapphire NITRO+ AMD Radeon RX 7900 XTX Vapor-X 24GB
    Sound Card
    External DAC: Cambridge Audio DACMagic200M - Headphone Amp: Topping L50
    Monitor(s) Displays
    Panasonic MX950 Mini LED 55" TV 120hz
    Screen Resolution
    3840 x 2160 120hz
    Hard Drives
    Samsung 980 Pro 2TB (OS)
    Samsung 980 Pro 1TB (Files)
    Lexar NZ790 4TB
    LaCie d2 Professional 6TB external - USB 3.1
    Seagate Expansion 16TB external - USB 3.2
    Seagate One Touch 18TB external HD - USB 3.0
    PSU
    Corsair RM1200x Shift
    Case
    Corsair RGB Smart Case 5000x (white)
    Cooling
    Corsair iCue H150i Elite Capellix XT
    Keyboard
    Incase Ergonomic USB (Microsoft clone)
    Mouse
    Logitech MX Master 3S
    Internet Speed
    Fibre 900/500 Mbps
    Browser
    Microsoft Edge Chromium
    Antivirus
    Bitdefender Total Security
    Other Info
    AMD Radeon Software & Drivers 26.1.1
    Hasleo Backup Suite
    Dashlane password manager
    Kensington Verimark fingerprint reader
    Logitech Brio 4K webcam
    Orico 10-port powered USB 3.0 hub
  • Operating System
    Windows 11 Pro 25H2
    Computer type
    Laptop
    Manufacturer/Model
    Asus Vivobook X1605VA
    CPU
    Intel® Core™ i9-13900H
    Motherboard
    Asus X1605VA bios 309
    Memory
    32GB DDR4-3200 Dual channel
    Graphics card(s)
    *Intel Iris Xᵉ Graphics G7
    Sound Card
    Realtek | Intel SST Bluetooth & USB
    Monitor(s) Displays
    16.0-inch, WUXGA 16:10 aspect ratio, IPS-level Panel
    Screen Resolution
    1920 x 1200 60hz
    Hard Drives
    512GB M.2 NVMe™ PCIe® 3.0 SSD
    Mouse
    Logitech MX Ergo Trackball
    Antivirus
    Bitdefender Total Security
    Other Info
    720p Webcam
    WiFi & USB to ethernet
@Brink

Hi Shawn, I'm using Bitdefender Total Security which manages the Windows Defender Firewall settings, does that in any way negate the reasons for backing up the firewall settings?

I suppose it couldn't hurt to have a backup to be safe.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
Back
Top Bottom