API Reference
Command
Set-CxDefenderExclusion
Adds or replaces Microsoft Defender exclusion entries on a computer.
Examples
Example 1: Adds SQL Server database file and process exclusions on the local computer.
PS>
Set-CxDefenderExclusion -Path 'D:\SQLData','E:\SQLLogs' -Process 'sqlservr.exe' -Extension 'mdf','ldf'
Example 2: Replaces the exclusion path list on a remote server with a controlled baseline.
PS>
Set-CxDefenderExclusion -ComputerName APP-SEC-01 -Path 'D:\Apps','D:\Telemetry' -Replace
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-CxDefenderExclusion [-Path <string[]>] [-Process <string[]>] [-Extension <string[]>] [-ComputerName <string>] [-Replace] [<CommonParameters>]#Parameters
- Path string[]
- File or folder paths to exclude from Microsoft Defender scans.
- Process string[]
- Process image names to exclude (e.g., 'sqlservr.exe').
- Extension string[]
- File extensions (without dot), e.g., 'ldf','mdf','vhdx'.
- ComputerName string
- Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.
- Replace SwitchParameter
- Replace existing lists instead of merging with them.