This tutorial will show you how to add or remove exclusions for Microsoft Defender Antivirus for Windows Security in Windows 10 and Windows 11.
Windows Security is built-in to Windows 11 and includes an antivirus program called Microsoft Defender Antivirus. Your device will be actively protected from the moment you start Windows 11. Windows Security continually scans for malware (malicious software), viruses, and security threats. In addition to this real-time protection, updates are downloaded automatically to help keep your device safe and protect it from threats.
If you trust a file, file type, folder, or a process that Windows Security has detected as malicious, you can stop Windows Security from alerting you or blocking the program by adding the file to the exclusions list.
References:
Virus and Threat Protection in the Windows Security App - Microsoft Support

Virus and Threat Protection in the Windows Security App - Microsoft Support


Configure custom exclusions for Microsoft Defender Antivirus - Microsoft Defender for Endpoint
You must be signed in as an administrator to view, add, or remove exclusions for Microsoft Defender Antivirus.
File and folder exclusions are stored in the registry key below.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths
File type exclusions are stored in the registry key below.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Extensions
Process exclusions are stored in the registry key below.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Processes
Only add exclusions for files that you are confident are safe. Adding an exclusion for an unsafe program could expose your systems and data to increased risk since they will no longer be scanned by Microsoft Defender Antivirus.
- Option One: Add Exclusions to Microsoft Defender Antivirus in Windows Security
- Option Two: Remove Exclusions from Microsoft Defender Antivirus in Windows Security
- Option Three: Add or Remove File Exclusion for Microsoft Defender Antivirus in PowerShell
- Option Four: Add or Remove Folder Exclusion for Microsoft Defender Antivirus in PowerShell
- Option Five: Add or Remove File Type Exclusion for Microsoft Defender Antivirus in PowerShell
- Option Six: Add or Remove Process Exclusion for Microsoft Defender Antivirus in PowerShell
1 Open Windows Security.
2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)
3 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)
4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)
5 If prompted by UAC, click/tap on Yes.
6 Click/tap on the Add an exclusion plus button, and do step 7 (file), step 8 (folder), step 9 (file type), or step 10 (process) below for what type of exclusion you want to add. (see screenshot below)
This option is to add a specific file as an exclusion to no longer be scanned by Windows Defender Antivirus.
This option is to add a folder as an exclusion to no longer have the folder and files inside the folder scanned by Microsoft Defender Antivirus.
This option is to add a file extension as an exclusion to no longer have that file type scanned by Microsoft Defender Antivirus.
This option is to add a process as an exclusion to no longer have any file associated with the process scanned by Microsoft Defender Antivirus.
11 When finished, you can close Settings if you like.
1 Open Windows Security.
2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)
3 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)
4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)
5 If prompted by UAC, click/tap on Yes.
6 Click/tap on an added extension you want to remove to expand it open. (see screenshot below)
7 Click/tap on Remove.
8 When finished, you can close Settings if you like.

Add-MpPreference (Defender)

Remove-MpPreference (Defender)
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.
Add-MpPreference -ExclusionPath "<Full path of file>" -Force
Remove-MpPreference -ExclusionPath "<Full path of file>" -Force
Substitute <Full path of file> in the commands above with the actual full path of the file (ex: "C:\Windows\notepad.exe") you want to add or remove as an exclusion.
For example:
Add-MpPreference -ExclusionPath "C:\Windows\notepad.exe" -Force
Remove-MpPreference -ExclusionPath "C:\Windows\notepad.exe" -Force
3 You can now close the elevated PowerShell if you like.

Add-MpPreference (Defender)

Remove-MpPreference (Defender)
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.
Add-MpPreference -ExclusionPath "<Full path of folder>" -Force
Remove-MpPreference -ExclusionPath "<Full path of folder>" -Force
Substitute <Full path of folder> in the commands above with the actual full path of the folder (ex: "C:\Users\Brink\Pictures") you want to add or remove as an exclusion.
For example:
Add-MpPreference -ExclusionPath "C:\Users\Brink\Pictures" -Force
Remove-MpPreference -ExclusionPath "C:\Users\Brink\Pictures" -Force
3 You can now close the elevated PowerShell if you like.

Add-MpPreference (Defender)

Remove-MpPreference (Defender)
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.
Add-MpPreference -ExclusionExtension "<File type extension>" -Force
Remove-MpPreference -ExclusionExtension "<File type extension>" -Force
Substitute <File type extension> in the commands above with the actual file type extension (ex: ".jpg") you want to add or remove as an exclusion.
For example:
Add-MpPreference -ExclusionExtension ".jpg" -Force
Remove-MpPreference -ExclusionExtension ".jpg" -Force
3 You can now close the elevated PowerShell if you like.

Add-MpPreference (Defender)

Remove-MpPreference (Defender)
1 Open Windows Terminal (Admin), and select Windows PowerShell.
2 Type the command you want to use below into Windows Terminal (Admin), and press Enter.
Add-MpPreference -ExclusionProcess "<Process name>" -Force
Remove-MpPreference -ExclusionProcess "<Process name>" -Force
Substitute <Process name> in the commands above with the actual process name (ex: "SecHealthUI.exe") you want to add or remove as an exclusion.
For example:
Add-MpPreference -ExclusionProcess "SecHealthUI.exe" -Force
Remove-MpPreference -ExclusionProcess "SecHealthUI.exe" -Force
3 You can now close the elevated PowerShell if you like.
That's it,
Shawn Brink