Advanced Windows Defender configuration with PowerShell

Configure advanced Windows Defender policies: folder/process exclusions, cloud protection level, PUA behavior and quarantine configuration, all from PowerShell.

Advanced Windows Defender configuration with PowerShell

PowerShell allows granular configuration of Windows Defender: folder and process exclusions, cloud protection level, behavior for potentially unwanted applications (PUA) and quarantine configuration.

Add folder exclusion
Add-MpPreference -ExclusionPath "C:\MyApp\bin"
View current configuration
Get-MpPreference | Select-Object ExclusionPath, ExclusionProcess, CloudBlockLevel

Most useful Set-MpPreference parameters

ParameterDescription
-ExclusionPathExcludes a path from scanning
-ExclusionProcessExcludes a process by name
-CloudBlockLevelCloud blocking level (0-6)
-PUAProtectionBlock potentially unwanted apps
-DisableRealtimeMonitoringDisable real-time monitoring (admin)