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.

Windowsexploit-protectionsecuritypowershellLow risk
Run `Set-ProcessMitigation -Name "C:\Apps\legacy.exe" -Enable DEP, EmulateAtlThunk` to apply Exploit Protection mitigations to that executable.

01Command

Command
$ Set-ProcessMitigation -Name "C:\Apps\legacy.exe" -Enable DEP, EmulateAtlThunk

02What 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

RiskLow risk
RequirementsWindows 10 1709+ / Windows 11; administrator PowerShell; the ProcessMitigations module is built in.
!Warning: Mitigations can break old apps that rely on the behaviors they stop — enable them one at a time and test the program.

04Undo

Undo
$ Set-ProcessMitigation -Name "C:\Apps\legacy.exe" -Remove

05Sources

  • Get-ProcessMitigation (ProcessMitigations)
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Module reference documents Get-ProcessMitigation for reading current mitigation settings of a process image.
  • Set-ProcessMitigation (ProcessMitigations)
    Microsoft Learn · vendor-doc · 2026-09-17
    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