Enable Exploit Protection for a Program with Set-ProcessMitigation
Turn on DEP, forced ASLR, and other mitigations for a legacy app from PowerShell instead of the GUI.
01Command
$ Set-ProcessMitigation -Name "C:\Apps\legacy.exe" -Enable DEP, EmulateAtlThunk02What it does
Windows Security's Exploit Protection settings are backed by this cmdlet, which can enable mitigations per executable or system-wide. Common values include DEP, ForceRelocateImages (forced ASLR), and EmulateAtlThunk; Get-ProcessMitigation shows what's already set. This is the supported way to protect old in-house tools that no longer receive security fixes.
03Risk
04Undo
$ Set-ProcessMitigation -Name "C:\Apps\legacy.exe" -Remove05Sources
- Get-ProcessMitigation (ProcessMitigations)Evidence: Module reference documents Get-ProcessMitigation for reading current mitigation settings of a process image.
- Set-ProcessMitigation (ProcessMitigations)Evidence: Documents -Name, -Enable, -Disable, -Remove and -Force parameters and mitigation names such as DEP and ForceRelocateImages.
Last verified: 2026-09-19 · Category: Security & Privacy
06Related solutions
Read the Authenticode signature status and signer of any executable or script in PowerShell.
Understand PowerShell's execution policy scopes and set the one that lets you run your own local scripts without gutting the security model.
Search inside text files and logs with regex, returning file, line number and match.