Unable to add Cscript.exe 32 Bit to DEP on Windows Server 2012R2 and 2016R2
Symptom
Unable to exclude cscript.exe from DEPS.
Error message - This program must run with data execution protection(DEP) enabled. You cannot turn off DEP for this program.
Environment
9.6;9.7;9.8;9.9;9.9.5;9.10;10.0;10.1;10.2;10.3;10.4;10.5;10.6;10.7;10.8 Component: Central Policy Manager (CPM) Functional Area: Other
Cause
Cscript.exe 32 bit is compiled with the /NXCOMPAT flag. This prevents exe's being added to the DEP's exclusion
Resolution
The official solution should be to disable DEP completely. See Article: "PMterminal.exe crashes when running a plugin that uses cscript.exe" for instruction.
However if adamant that DEP is only disabled for Cscript.exe, the Cscript.exe will need to recompile with Editbin.exe that comes with Visual Studio to remove the /NXCOMPAT flag.
This can be achieved with the command editbin /NXCOMPAT:NO C:\cscript.exe
Attached is a Cscript.exe 32 Bit (Windows Server 2012Rs version) in which the /NXCOMPAT flag has been removed.
This can be extracted to the CPM Bin directory <Drive>:\Program Files (x86)\CyberArk\Password Manager\bin
After which this version of Cscript.exe can be added to DEP exclusion list.
https://serverfault.com/questions/540201/how-do-i-make-an-exception-for-cscript-exe-in-windows-server-2008-r2
This is not an official recommendation or suggestion, but there's some useful information in there that may help them understand why this is happening. Attached to this article is a recompiled Cscript.exe (32Bit) with the DEP flag removed taken from a Windows 2012R2 CPM lab in which the instructions in the associated article above have been applied. In testing we were able to add this version of cscript.exe to my DEP exception list.