+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" |
+
+
+### Review the exclusion lists with PowerShell
+
+You can retrieve the items in any of the lists in two ways:
+- Retrieve the status of all Windows Defender AV preferences. Each of the three lists will be displayed on separate lines, but the items within the list will be combined into the same line.
+- Write the status of all preferences to a variable, and only call the specific list you are interested in. Each use of `Add-MpPreference` is written to a new line.
+
+In both instances the items are sorted alphabetically.
+
+The following sequence of code examples helps to show how this works.
+
+1. Create an example list of extensions that should be excluded from scans:
+ ```PowerShell
+ PS C:\> Set-MpPreference -ExclusionExtension ".test1, .test2"
+ ```
+
+2. Add some additional extensions:
+
+ ```PowerShell
+ PS C:\> Add-MpPreference -ExclusionExtension ".test40, test50"
+ ```
+
+3. Add another set of extensions:
+
+ ```PowerShell
+ PS C:\> Add-MpPreference -ExclusionExtension ".secondadd1, .secondadd2"
+ ```
+
+4. Review the list as a combined list:
+ ```PowerShell
+ PS C:\> Get-MpPreference
+ ```
+
+ 
+
+
+5. Use a variable to store and retrieve only the exclusions list:
+
+ ```PowerShell
+ PS C:\> $WDAVprefs = Get-MpPreference
+ PS C:\> $WDAVprefs.ExclusionExtension
+ ```
+
+ 
+
See [Use PowerShell cmdlets to configure and run Windows Defender Antivirus](use-powershell-cmdlets-windows-defender-antivirus.md) and [Defender cmdlets](https://technet.microsoft.com/itpro/powershell/windows/defender/index) for more information on how to use PowerShell with Windows Defender Antivirus.
-**Use Windows Management Instruction (WMI) to configure file extension exclusions:**
+### Use Windows Management Instruction (WMI) to configure file extension exclusions
-Use the [**Set** method of the **MSFT_MpPreference**](https://msdn.microsoft.com/en-us/library/dn455323(v=vs.85).aspx) class for the following properties:
+Use the [ **Set**, **Add**, and **Remove** methods of the **MSFT_MpPreference**](https://msdn.microsoft.com/en-us/library/dn455323(v=vs.85).aspx) class for the following properties:
```WMI
-DisableAutoExclusions
+ExclusionExtension
+ExclusionPath
+ExclusionProcess
```
+The use of **Set**, **Add**, and **Remove** are analogous to their counterparts in PowerShell: `Set-MpPreference`, `Add-MpPreference`, and `Remove-MpPreference`.
+
See the following for more information and allowed parameters:
- [Windows Defender WMIv2 APIs](https://msdn.microsoft.com/en-us/library/dn439477(v=vs.85).aspx)
-
-
-
-
+