Privacy and Security Add or Remove Exclusions for Microsoft Defender Antivirus in Windows 11


  • Staff
Windows_Security_banner.png

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:


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.



Contents

  • 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




Option One

Add Exclusions to Microsoft Defender Antivirus in Windows Security


1 Open Windows Security.

2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)

Windows_Security-1.png

3 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)

Windows_Security-2.png

4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)

Windows_Security-3.png

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)

Windows_Security_add_exclusions-1.png

7 Add File Exclusion to Microsoft Defender Antivirus in Windows Security

This option is to add a specific file as an exclusion to no longer be scanned by Windows Defender Antivirus.


A) Click/tap on File in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Navigate to and select a file (ex: "notepad.exe") you want to exclude, click/tap on Open, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-2.png

8 Add Folder Exclusion to Microsoft Defender Antivirus in Windows Security

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.


A) Click/tap on Folder in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Navigate to and select a folder (ex: "Pictures") you want to exclude, click/tap on Select Folder, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-3.png

9 Add File Type Exclusion to Microsoft Defender Antivirus in Windows Security

This option is to add a file extension as an exclusion to no longer have that file type scanned by Microsoft Defender Antivirus.


A) Click/tap on File type in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Type a file extension (ex: ".jpg") you want to exclude, click/tap on Add, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-4.png

10 Add Process Exclusion to Microsoft Defender Antivirus in Windows Security

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.


A) Click/tap on Process in the Add an exclusion drop menu. (see screenshot below step 6)​

B) Type a process name (ex: "SecHealthUI.exe") you want to exclude, click/tap on Add, and go to step 11 below. (see screenshot below)​

Windows_Security_add_exclusions-5.png

11 When finished, you can close Settings if you like.




Option Two

Remove Exclusions from Microsoft Defender Antivirus in Windows Security


1 Open Windows Security.

2 Click/tap on Virus & threat protection in Windows Security. (see screenshot below)

Windows_Security-1.png

3 Click/tap on the Manage settings link under Virus & threat protection settings. (see screenshot below)

Windows_Security-2.png

4 Click/tap on the Add or remove exclusions link under Virus & threat protection settings. (see screenshot below)

Windows_Security-3.png

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.

Windows_Security_remove_exclusions.png





Option Three

Add or Remove File Exclusion for Microsoft Defender Antivirus in PowerShell



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 file exclusion)​
Add-MpPreference -ExclusionPath "<Full path of file>" -Force

OR​

(Remove file exclusion)​
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.




Option Four

Add or Remove Folder Exclusion for Microsoft Defender Antivirus in PowerShell



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 folder exclusion)​
Add-MpPreference -ExclusionPath "<Full path of folder>" -Force

OR​

(Remove folder exclusion)​
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.




Option Five

Add or Remove File Type Exclusion for Microsoft Defender Antivirus in PowerShell



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 file type exclusion)​
Add-MpPreference -ExclusionExtension "<File type extension>" -Force

OR​

(Remove file type exclusion)​
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.




Option Six

Add or Remove Process Exclusion for Microsoft Defender Antivirus in PowerShell



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 process exclusion)​
Add-MpPreference -ExclusionProcess "<Process name>" -Force

OR​

(Remove process exclusion)​
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
 

Attachments

  • Windows_Security.png
    Windows_Security.png
    6 KB · Views: 66
Last edited:

Latest Support Threads

Back
Top Bottom