What this check looks at
Checks zero-hour auto purge is on in the default anti-malware policy, so an attachment found to be malware after delivery is taken out of the mailbox.
The default anti-malware policy scans every attachment as it arrives. Zero-hour auto purge for malware goes further: when an attachment already delivered is later found to be malware, it removes that message from the mailbox and puts it in quarantine.
The check reads the default anti-malware policy and passes when the purge is on. It fails when it is off, and reports not checked when the policy or the setting was not returned.
Why it matters
New malware is often only recognised after the first copies have been delivered. Without the purge those copies stay in the inbox, and the person who opens one later is infected by a file Microsoft already knows is malicious.
New malware is often only recognised once it has been seen a few times, after the first copies have been delivered. Without the purge, the attachment sits in the inbox until someone opens it, even though Microsoft by then knows exactly what it is.
The purge is on by default and has no cost to keep on: it acts only on attachments found to be malicious, and the message goes to quarantine, where an administrator can see what was removed and from whom.
How to fix it
Where: Microsoft Defender portal → Email & collaboration → Policies & rules → Threat policies → Anti-malware
Before you start
- Nothing to prepare: the purge acts only on attachments Microsoft later finds to be malware.
Step by step
- See the setting. Connect with Connect-ExchangeOnline and run Get-MalwareFilterPolicy | Format-Table Name, IsDefault, ZapEnabled to see the purge setting of each anti-malware policy.
- Turn the purge on. In the Defender portal open Email & collaboration → Policies & rules → Threat policies → Anti-malware, open the default policy and tick Enable zero-hour auto purge for malware. Or run Set-MalwareFilterPolicy -Identity Default -ZapEnabled $true.
- Check the other policies. If other anti-malware policies apply to some people, turn the purge on in each of them too, with the same setting or Set-MalwareFilterPolicy and that policy’s name.
- Confirm the setting. Run the command from the first step again and check ZapEnabled is True. The next assessment passes.
With PowerShell
Set-MalwareFilterPolicy -Identity Default -ZapEnabled $true
What users will notice
An attachment found to be malware after delivery is moved to quarantine, out of the mailbox.
How to confirm it worked
Get-MalwareFilterPolicy -Identity Default | Format-List ZapEnabled shows True.
Frameworks and controls
This check maps to controls in 13 frameworks. Passing it is evidence that the setting is in place, not a certification against any of them.
| Framework | Control |
|---|---|
| NCSC CAF | B4.b Secure configuration |
| DSPT | Standard 9: IT protection |
| NIS2 | Art. 21(2)(e) Security in acquisition, development and maintenance, including vulnerability handling |
| Microsoft Cloud Security Benchmark | ES-2 Use modern anti-malware software |
| Zero Trust | Applications |
| SOC 2 | CC6.8 Preventing or detecting unauthorised or malicious software |
| PCI DSS 4.0.1 | 5.2.1 An anti-malware solution is deployed on all system components |
| NIST SP 800-171 | 3.14.2 Provide protection from malicious code |
| CMMC Level 2 | SI.L2-3.14.2 Malicious Code Protection |
| ISO 27001:2022 | A.8.7 Protection against malware |
| CIS Controls v8.1 | 9.7 Deploy and maintain email server anti-malware protections (IG3)10.1 Deploy and maintain anti-malware software (IG1) |
| NIST CSF 2.0 | RS.MI-01: Incidents are contained |
| NCSC 10 Steps | Architecture and configurationIncident management |
The framework mappings were last checked against the published standards in October 2026.
Microsoft’s documentation
- Zero-hour auto purge in Exchange Online (Microsoft Learn)