What Are Microsoft Defender Exclusions in Windows?
Microsoft Defender exclusions are trusted items that Microsoft Defender Antivirus skips during scanning. Depending on the exclusion type, Defender can stop scanning a specific file, an entire folder, a file extension, or files opened by a specified process.
Exclusions are useful when Defender repeatedly flags a trusted internal tool, slows down a development folder, scans large temporary files, or interferes with a known safe application. However, an exclusion also creates a blind spot. Anything placed in an excluded location may avoid normal antivirus checks.
Downloads, Desktop, or C:\Users. Add the narrowest possible exclusion only when you trust the file or folder.
Windows Security app
Use the graphical interface to add one file, folder, file type, or process exclusion.
RecommendedPowerShell
Use Defender cmdlets to add, list, or remove exclusions quickly and precisely.
AdvancedGroup Policy
Apply exclusions centrally on Windows Pro, Enterprise, Education, or domain-managed PCs.
PolicyWhen Should You Add a Microsoft Defender Antivirus Exclusion?
You should add a Defender exclusion only when there is a clear reason and the item is trusted. In many cases, it is safer to restore a false positive from Protection history, update the app, or report the detection to the software vendor instead of excluding a broad folder.
Good reasons
- A verified business application is repeatedly scanned and causes performance issues.
- A trusted developer build folder contains many temporary files created during compilation.
- A vendor documents a specific Defender exclusion for its product.
- A known safe file is repeatedly detected as a false positive.
- A lab or test folder must be excluded for controlled troubleshooting.
Bad reasons
- A downloaded file is blocked and you do not know exactly what it does.
- A website tells you to disable Defender or exclude a whole drive.
- A game crack, patcher, keygen, or unknown script is detected.
- You want to hide malware-like behavior from antivirus scanning.
- You are excluding broad user folders instead of one trusted path.
.exe, .dll, .ps1, or .js, because they can weaken protection across the whole PC.
Before You Add an Exclusion in Windows Defender
Before changing Microsoft Defender settings, confirm that the item is trustworthy. If you exclude the wrong path, malware can be saved or executed there with less chance of being detected by standard scans.
- Scan the file or folder first with Microsoft Defender.
- Update Windows Security intelligence before testing the exclusion.
- Check the publisher, digital signature, and download source of the program.
- Create a dedicated folder for the trusted app instead of excluding a busy shared folder.
- Write down what you excluded and why, so you can review it later.
Update Defender definitions first
- Open Windows Security.
- Go to Virus & threat protection.
- Open Protection updates.
- Click Check for updates.
How to Add an Exclusion in Microsoft Defender Using Windows Security
The easiest way to add an exclusion is through the Windows Security app. The steps are almost the same in Windows 10 and Windows 11.
Open the exclusions page
- Open the Start menu.
- Type Windows Security and open the app.
- Select Virus & threat protection.
- Under Virus & threat protection settings, click Manage settings.
- Scroll down to Exclusions.
- Click Add or remove exclusions.
- Confirm the UAC prompt if Windows asks for administrator permission.
- Click Add an exclusion.
- Choose File, Folder, File type, or Process.
Add a folder exclusion
- Click Add an exclusion.
- Select Folder.
- Choose the trusted folder, for example
C:\Tools\TrustedApp. - Click Select Folder.
- Verify that the folder appears in the exclusions list.
Microsoft Defender Exclusion Types Explained
Microsoft Defender offers several exclusion types. Choosing the right one matters because some exclusions are much broader than others.
| Exclusion type | What it excludes | Example | Risk level |
|---|---|---|---|
| File | One specific file. | C:\Tools\app.exe |
Lower |
| Folder | A folder and the files inside it, including subfolders. | C:\Tools\TrustedApp |
Medium |
| File type | All files with a selected extension. | .test |
High |
| Process | Files opened by the specified process. | trustedtool.exe |
Medium to high |
File exclusion
Choose File when only one trusted file is causing the issue. This is usually safer than excluding a folder.
Folder exclusion
Choose Folder for a trusted application directory, build output directory, virtual machine storage folder, or other controlled location. Do not use it for general-purpose folders.
File type exclusion
Choose File type only when you fully understand the impact. A file type exclusion applies everywhere on the computer, so it can weaken protection significantly.
Process exclusion
Choose Process when files opened by a specific trusted process should not be scanned. This is usually an administrator-level setting for specialized software, developer tools, or business applications.
How to Add Microsoft Defender Exclusions with PowerShell
PowerShell is useful when you need to add exclusions quickly, document changes, or apply the same setting on several computers. Open Windows Terminal or PowerShell as administrator before running these commands.
Add a folder exclusion
Add-MpPreference -ExclusionPath "C:\Tools\TrustedApp"
Add a single file exclusion
Add-MpPreference -ExclusionPath "C:\Tools\TrustedApp\app.exe"
Add a file type exclusion
Add-MpPreference -ExclusionExtension ".test"
Add a process exclusion
Add-MpPreference -ExclusionProcess "C:\Tools\TrustedApp\trustedtool.exe"
Add-MpPreference to add entries to the existing list. Be careful with Set-MpPreference, because it can replace existing exclusion lists if used incorrectly.
Add multiple exclusions at once
Add-MpPreference -ExclusionPath "C:\Tools\TrustedApp","D:\VMs\TrustedLab"
Add-MpPreference -ExclusionExtension ".test",".build"
After adding exclusions, open Windows Security and confirm that the entries appear under Add or remove exclusions.
How to Check or Remove Microsoft Defender Exclusions
It is a good idea to review Defender exclusions regularly. Remove anything you no longer need, especially old test paths, temporary folders, and exclusions created for software you have already uninstalled.
Check exclusions with Windows Security
- Open Windows Security.
- Go to Virus & threat protection.
- Click Manage settings.
- Open Add or remove exclusions.
- Review every listed file, folder, file type, and process.
Check exclusions with PowerShell
Get-MpPreference | Select-Object ExclusionPath, ExclusionExtension, ExclusionProcess
Remove a folder or file exclusion
Remove-MpPreference -ExclusionPath "C:\Tools\TrustedApp"
Remove a file type exclusion
Remove-MpPreference -ExclusionExtension ".test"
Remove a process exclusion
Remove-MpPreference -ExclusionProcess "C:\Tools\TrustedApp\trustedtool.exe"
How to Add Microsoft Defender Exclusions Using Group Policy
Group Policy is useful on Windows Pro, Enterprise, Education, and domain-managed computers. It is not available in Windows Home without unsupported workarounds.
Open the Defender exclusions policy path
- Press Win + R.
- Type
gpedit.mscand press Enter. - Go to Computer Configuration.
- Open Administrative Templates.
- Go to Windows Components.
- Open Microsoft Defender Antivirus.
- Open Exclusions.
Computer Configuration → Administrative Templates → Windows Components → Microsoft Defender Antivirus → Exclusions
Common policy settings
| Policy | Use it for | Value format |
|---|---|---|
| Path Exclusions | Files or folders. | C:\Tools\TrustedApp |
| Extension Exclusions | File extensions. | .test |
| Process Exclusions | Files opened by specified processes. | C:\Tools\TrustedApp\trustedtool.exe |
Add a path exclusion with Group Policy
- Double-click Path Exclusions.
- Set the policy to Enabled.
- Click Show under the options list.
- Enter the path in the Value name column.
- Enter
0in the Value column. - Click OK and close the policy editor.
- Run
gpupdate /forceor restart the computer.
Fix Microsoft Defender Exclusions That Are Missing, Locked, or Not Working
If you cannot add or remove exclusions, or if exclusions disappear after a restart, check the items below.
| Problem | Possible cause | What to check |
|---|---|---|
| The exclusions page is greyed out. | The PC is managed by an organization or policy. | Settings → Accounts → Access work or school; Group Policy; Intune policy. |
| PowerShell command fails. | PowerShell is not running as administrator. | Open Windows Terminal as administrator and run the command again. |
| Exclusion disappears later. | Domain policy or security software overwrites local settings. | Check applied policies and third-party endpoint protection. |
| Defender still detects the app. | Wrong path, renamed executable, or a different protection feature is involved. | Verify the exact file path and review Protection history. |
| Windows Security shows a warning. | The exclusion is broad or risky. | Narrow the exclusion to a specific file or trusted application folder. |
Check whether another antivirus is active
If another antivirus product is installed, Microsoft Defender Antivirus may run in a different mode and some controls may not behave as expected. Open Windows Security → Virus & threat protection and check which provider is currently active.
Check whether the PC is managed
If you see messages such as This setting is managed by your administrator or Your organization manages some settings, local exclusion settings may be controlled by policy. On a company computer, contact the administrator instead of trying to bypass the policy.
Microsoft Defender Exclusions FAQ
Q Is it safe to add an exclusion in Microsoft Defender?⌄
Q Does a folder exclusion include subfolders?⌄
Q Should I exclude an entire drive from Microsoft Defender?⌄
Q Why is “Add or remove exclusions” locked?⌄
Q Can I add exclusions on Windows Home?⌄
Q What is better: a file exclusion or a folder exclusion?⌄
Conclusion
The safest way to add a Microsoft Defender exclusion is to use the smallest possible scope: one trusted file first, then a dedicated folder only if necessary. Use Windows Security for everyday changes, PowerShell for precise administration, and Group Policy for managed environments. Review exclusions regularly and remove anything that is no longer needed.