Common mistakes to avoid when defining exclusions
You can define an exclusion list for items that you don't want Microsoft Defender Antivirus to scan. Such excluded items could contain threats that make your device vulnerable. This article describes some common mistake that you should avoid when defining exclusions.
Before defining your exclusion lists, see Recommendations for defining exclusions.
Excluding certain trusted items
Certain files, file types, folders, or processes should not be excluded from scanning even though you trust them to be not malicious.
Do not define exclusions for the folder locations, file extensions, and processes that are listed in the following sections:
- Folder locations
- File extensions
In general, do not define exclusions for the following folder locations:
C:\Program Files (x86)\Contoso\
C:\Users\<UserProfileName>\AppData\Local\Temp\ Note the following exception for SharePoint: Do exclude
C:\Users\ServiceAccount\AppData\Local\Temp when you use file-level antivirus protection in SharePoint.
C:\Users\<UserProfileName>\AppData\LocalLow\Temp\ Note the following exception for SharePoint: Do exclude
C:\Users\Default\AppData\Local\Temp when you use file-level antivirus protection in SharePoint.
Linux and macOS Platforms
In general, do not define exclusions for the following file extensions:
In general, do not define exclusions for the following processes:
Linux and macOS Platforms
You can choose to exclude file types, such as
.png if your environment has a modern, up-to-date software with a strict update policy to handle any vulnerabilities.
Using just the file name in the exclusion list
Malware might have the same name as that of a file that you trust and want to exclude from scanning. Therefore, to avoid excluding potential malware from scanning, use a fully qualified path to the file that you want to exclude instead of using just the file name. For example, if you want to exclude
Filename.exe from scanning, use the complete path to the file, such as
Using a single exclusion list for multiple server workloads
Do not use a single exclusion list to define exclusions for multiple server workloads. Split the exclusions for different application or service workloads into multiple exclusion lists. For example, the exclusion list for your IIS Server workload must be different from the exclusion list for your SQL Server workload.
Using incorrect environment variables as wildcards in the file name and folder path or extension exclusion lists
Microsoft Defender Antivirus Service runs in system context using the LocalSystem account, which means it gets information from the system environment variable, and not from the user environment variable. Use of environment variables as a wildcard in exclusion lists is limited to system variables and those applicable to processes running as an NT AUTHORITY\SYSTEM account. Therefore, do not use user environment variables as wildcards when adding Microsoft Defender Antivirus folder and process exclusions. See the table under System environment variables for a complete list of system environment variables.
See Use wildcards in the file name and folder path or extension exclusion lists for information on how to use wildcards in exclusion lists.