diff --git a/windows/keep-secure/configure-process-opened-file-exclusions-windows-defender-antivirus.md b/windows/keep-secure/configure-process-opened-file-exclusions-windows-defender-antivirus.md index fb9259cd91..568800ecf5 100644 --- a/windows/keep-secure/configure-process-opened-file-exclusions-windows-defender-antivirus.md +++ b/windows/keep-secure/configure-process-opened-file-exclusions-windows-defender-antivirus.md @@ -1,5 +1,5 @@ --- -title: Configure and valudate exclusions for files opened by specific processes +title: Configure and validate exclusions for files opened by specific processes description: You can exclude files from scans if they have been opened by a specific process. keywords: process, exclusion, files, scans search.product: eADQiWindows 10XVcnh @@ -224,232 +224,6 @@ $client.DownloadFile("http://www.eicar.org/download/eicar.com.txt","c:\test.txt" ``` - - - - - - -## Use PowerShell cmdlets and WMI to configure exclusion lists - -Excluding and reviewing file extensions, paths and files (including processes), and files opened by processes with PowerShell requires using a combination of four cmdlets and the appropriate exclusion list parameter. The cmdlets are all in the [Defender module](https://technet.microsoft.com/en-us/itpro/powershell/windows/defender/defender). - -There are three exclusion lists: -- ExclusionExtension -- ExclusionPath -- ExclusionProcess - -You can modify each of the lists with the following cmdlets: -- Set-MpPreference to create or overwrite the defined list -- Add-MpPreference to add new items to the defined list -- Remove-MpPreference to remove or delete items from the defined list -- Get-MpPreference to review the items in the list, either all at once with all other Windows Defender AV settings, or individually for each of the lists - ->[!IMPORTANT] ->If you have created a list, either with `Set-MpPreference` or `Add-MpPreference`, using the `Set-MpPreference` cmdlet again will overwrite the existing list. - -The following matrix provides sample commands based on what you want to exclude, and whether you want to create a list, add to the list, or remove items from the list. - -
Configuration action | Type of exclusion | PowerShell command |
---|---|---|
Create or overwrite a list | File extensions that should be excluded from scans | -Set-MpPreference -ExclusionExtension ".extension1, .extension2, .extension3" |
Files (including processes) and paths that should be excluded from scans | -Set-MpPreference -ExclusionPath "c:\example, d:\test\process.exe, c:\test\file.bat" | |
Files opened by the specified processes (executables) | -Set-MpPreference -ExclusionProcess "c:\example\test.exe" | |
Add to a list | File extensions that should be excluded from scans | -Add-MpPreference -ExclusionExtension ".extension4, .extension5" |
Files (including processes) and paths that should be excluded from scans | -Add-MpPreference -ExclusionPath "d:\test, d:\example\file.png" | |
Files opened by specified processes (executables) | -Add-MpPreference -ExclusionProcess "f:\test\sample.exe" | |
Remove items from a list | File extensions that should be excluded from scans | -Remove-MpPreference -ExclusionExtension ".extension1, .extension4, .extension5" |
Files (including processes) and paths that should be excluded from scans | -Remove-MpPreference -ExclusionPath "c:\example, d:\example\file.png" | |
Files opened by specified processes (executables) | -Remove-MpPreference -ExclusionProcess "c:\example\test.exe" |