Skip to content
Windows 🟡 Intermediate

Turn On Attack Surface Reduction Rules in Windows 11

Richard
Written by
Richard
9 min read
A Windows 11 desktop with an open dark Windows Terminal window and a Windows Security shield icon, illustrating how to enable Attack Surface Reduction rules.
A Windows 11 desktop with an open dark Windows Terminal window and a Windows Security shield icon, illustrating how to enable Attack Surface Reduction rules.
Before you start
  • 22 steps
  • Needs administrator rights
  • Group Policy needs Windows 11 Pro, Enterprise or Education

Attack Surface Reduction (ASR) rules in Windows 11 block specific risky behaviors, such as an Office app launching a script or a process reading credentials from memory. The quickest way is a PowerShell command, run in Windows Terminal opened as administrator. It turns each rule on in audit mode first, then switches it to block.

ASR is part of Microsoft Defender Antivirus. Windows Security has no toggle for these rules on current Windows 11 versions (25H2 and 26H2), so PowerShell is the practical route for a single PC.

No restart is normally needed. The rule takes effect as soon as Microsoft Defender Antivirus saves the setting.

⚡ Quick Answer

Turn on Attack Surface Reduction rules in Windows 11 with PowerShell, because Windows Security has no toggle for them on versions 25H2 and 26H2. Open Windows Terminal as administrator, then run Add-MpPreference with the rule’s GUID and AuditMode. Review the log, then switch the rule to Enabled to block it. Microsoft Defender Antivirus must be the active antivirus.

Advertisement

What Attack Surface Reduction Rules Do

An attack surface is every way software on your PC can be pushed into doing something harmful. ASR rules shrink it by blocking behaviors that malware commonly uses but that most legitimate software never needs.

Each rule targets one behavior. One blocks executable content in email. One stops Office apps from creating child processes (other programs started by the app). One protects the Local Security Authority Subsystem Service (lsass.exe, the process that holds sign-in credentials in memory).

Advertisement

Every rule has an action:

  • Disabled: the rule does nothing.
  • Enabled (block): Windows stops the behavior.
  • AuditMode: Windows allows the behavior but logs what the rule would have blocked.
  • Warn: Windows blocks the behavior and shows a prompt that the user can override. Some rules do not support Warn.

Before You Start

📝Good to KnowASR rules only work when Microsoft Defender Antivirus is the active antivirus. Check these points first:
  • Administrator rights. The PowerShell commands below change system-wide security settings, so they need an elevated window.
  • No third-party antivirus. If another antivirus product is installed, Microsoft Defender Antivirus runs in a passive mode and ASR rules do not apply.
  • Real-time protection on. The rules depend on it. Step 2 below checks it.
  • Edition. Microsoft lists Windows 11 Pro and Enterprise as supported editions. The commands also run on Windows 11 Home, but this article cannot confirm that Microsoft supports ASR there. Group Policy Editor is not available on Home at all.

Some rules block behavior that business software relies on. The rule that blocks process creations from PsExec (a tool for running programs on other computers) and WMI (Windows Management Instrumentation, an admin interface) conflicts with Microsoft Configuration Manager, software IT teams use to manage PCs. This is the reason to start in audit mode.

Turn On Attack Surface Reduction Rules in Windows 11 With PowerShell

These steps turn on Attack Surface Reduction rules in Windows 11. They check Microsoft Defender Antivirus, enable a rule in audit mode, review the log, and then switch the rule to block.

Advertisement
  1. Open Windows Security. Select Start, type “Windows Security”, and press Enter. The Windows Security window opens with a list of protection areas.
    Windows Security
    Windows Security
  2. Check Real-time protection. Select Virus & threat protection, then select Manage settings under Virus & threat protection settings. Make sure Real-time protection is on. Also turn on Cloud-delivered protection, an online service that checks files against Microsoft’s latest threat data. Some rules need it before they can decide whether a file is safe. If a third-party antivirus is named at the top of the page, stop here: Microsoft Defender Antivirus is not the active product.
    Windows Security
    Windows Security
  3. Open Windows Terminal as administrator. Right-click Start and select Terminal (Admin). This step requires administrator privileges. Select Yes at the User Account Control prompt. A PowerShell tab opens with “Administrator” in the title bar.
  4. List the rules already configured. Run this command:
    ⬛PowerShell
    Get-MpPreference | Select-Object AttackSurfaceReductionRules_Ids, AttackSurfaceReductionRules_Actions

    Empty output means no ASR rules are set on this PC. If you see rule IDs, note them. A rule ID is the GUID (a long string of letters and numbers) that identifies one rule.

  5. Find the ID of the rule you want. Open Microsoft’s “Attack surface reduction rules reference” on learn.microsoft.com and copy the GUID for the rule. Each rule on that page lists its GUID, name, and whether it supports Warn mode.
  6. Enable the rule in audit mode. Before you run the command, note this: Set-MpPreference replaces your whole rule list with the one you name. Use Add-MpPreference instead, so existing rules stay in place. Run the command below, which uses the rule that blocks credential stealing from lsass.exe as an example. Replace the ID to use a different rule.
    ⬛PowerShell
    Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions AuditMode

    The command returns to the prompt with no message. No output means it worked.

  7. Add more rules the same way. Repeat the previous command with each new ID. The rule list grows with each run.
  8. Confirm the rule is set. Run the command from step 4 again. The rule ID now appears in the first column, and a number appears in the second column at the same position. The number 2 means audit mode.
  9. Leave the rule in audit mode for one to two weeks. Use the PC as you normally would, so any real conflicts show up in the log. Open the Office files, scripts, and business apps you normally use. Audit mode logs what a rule would have blocked without stopping anything.
  10. Open Event Viewer. Select Start, type “Event Viewer”, and press Enter. The Event Viewer window opens.
    Event Viewer
    Event Viewer
  11. Go to the Defender log. In the left pane, expand Applications and Services Logs, then Microsoft, then Windows, then Windows Defender. Select Operational.
  12. Filter for audit events. Select Filter Current Log in the right pane, type 1122 in the event ID box, and select OK. Event ID 1122 records an action that audit mode allowed. Each event names the rule and the file or process involved. No events means the rule would not have disrupted anything.
  13. Decide what to do with each hit. If an event involves software you trust and need, leave that rule in audit mode or add an exclusion (see the exclusions section below). If every event is something you do not recognize, the rule is safe to enforce.
  14. Switch the rule to block. Run the same command with the Enabled action:
    ⬛PowerShell
    Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Enabled

    Windows updates the existing entry rather than adding a second one.

  15. Verify the block is active. Run the command from step 4 once more. The number beside the rule ID is now 1, which means block. From this point, a blocked action triggers a Windows notification and an event with ID 1121 in the same Operational log.

Choose Which Rules to Turn On

Microsoft’s reference lists more than a dozen rules. Start with the ones that block behavior almost no legitimate software uses:

  • Block executable content from email client and webmail
  • Block all Office applications from creating child processes
  • Block Office applications from injecting code into other processes
  • Block JavaScript or VBScript from launching downloaded executable content
  • Block execution of potentially obfuscated scripts
  • Block credential stealing from the Windows local security authority subsystem (lsass.exe)
  • Block Adobe Reader from creating child processes
  • Use advanced protection against ransomware
💡TipHold back on rules that check how trusted a file is, or that block tools IT teams use to manage PCs. These produce the most false alarms, particularly on IT-managed PCs. Audit mode shows quickly whether they affect you.

Rule names and GUIDs can change as Microsoft adds rules. Copy them from the reference page rather than from a saved list.

Advertisement

Exclude a Trusted File or Folder From ASR Rules

An exclusion tells ASR to ignore a specific file or folder. Use it when audit events show that a rule would block software you trust. Exclusions weaken protection, so keep them narrow.

  1. Open Terminal as administrator. Right-click Start and select Terminal (Admin). This step requires administrator privileges.
  2. Add the exclusion. Run this command, replacing the path with your own:
    ⬛PowerShell
    Add-MpPreference -AttackSurfaceReductionOnlyExclusions "C:\Tools\ExampleApp.exe"

    The exclusion applies to every ASR rule, not to one rule only.

  3. Check the list. Run Get-MpPreference | Select-Object AttackSurfaceReductionOnlyExclusions to list your exclusions. The path you added appears in the output.

Turn Off or Remove an ASR Rule

You can undo any rule at any time. Setting the action to Disabled keeps the rule in the list but stops it from acting. Removing the rule takes it out of the list completely.

  1. Open Terminal as administrator. Right-click Start and select Terminal (Admin). This step requires administrator privileges.
  2. Disable the rule. Run this command with the rule’s ID:
    ⬛PowerShell
    Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 -AttackSurfaceReductionRules_Actions Disabled
  3. Remove the rule from the list (optional). Run this command:
    ⬛PowerShell
    Remove-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2
  4. Confirm the change. Run the command from step 4 of the main procedure. The rule now shows 0, or no longer appears.
Advertisement

Why ASR Rules Do Not Work or Do Not Stay On

If the commands run without errors but no events appear, the cause is usually one of the points below.

  • Another antivirus is active. Microsoft Defender Antivirus runs in passive mode when a third-party product is installed. In that mode, the ASR rules have no effect. Remove the other product or use its own controls.
  • Real-time protection is off. Turn it on under Windows Security Virus & threat protection Manage settings.
  • The command shows a permissions error. The terminal window is not elevated. Close it and reopen it with Terminal (Admin).
  • The setting reverts after a restart or sign-in. A management policy from your employer or school overrides local PowerShell changes. Group Policy and Microsoft Intune are two common ways organisations set these policies. Ask your IT team to add the rule to the policy.
  • The log shows nothing. The rule only logs when the behavior actually occurs. Audit mode on a rule that no software on your PC triggers produces no events, which is a normal result.

Managing ASR Rules Across Several PCs

Group Policy and Microsoft Intune can push the same rules to many PCs and show reports centrally. Both are aimed at managed networks.

This article does not give a Group Policy path or registry location for ASR, because neither could be confirmed against a reliable source here. Use Microsoft’s current documentation for your management tool. On a single home or small-office PC, the PowerShell method above is the supported way to change the rules locally.

Advertisement

Other Settings to Review on a Surface

If this PC is a Surface, these related guides cover hardware settings you may want to check:

What to Do Next

Review the Operational log in Event Viewer every few weeks, looking for event ID 1121. Each block entry names the file or process involved, which shows whether a rule is catching real threats or interrupting legitimate work. If a rule you turned on starts blocking a tool you need, switch that rule back to AuditMode or add a narrow exclusion rather than turning it off altogether.

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Tags: #Windows 11

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

No comments yet — be the first to share your thoughts!

Leave a Comment

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