Microsoft Defender for Endpoint installation throws an Error with McAfee On-Access Scanner enabled.
Error : Could not set file security for file “C:\ProgramData\Microsoft\Windows Defender\Definition Updates\’ Error:0
Verify that you have sufficient privileges to modify the security permission for this file.”


Solution –
Stop the On-Access Scanner. Delete the Windows Defender folder on below location
C:\ProgramData\Microsoft
and re-install them with Access Protection and On-Access Scanner Off.
After adding the below exclusions in McAfee, We were able to install without disabling McAfee.
Low Risk Processes - MsSense.exe MSMPEng.exe Excluded Location - %ProgramFiles%\Windows Defender Advanced Threat Protection %ProgramFiles%\Windows Defender %\ProgramData%\Microsoft\Windows Defender %\ProgramData%\Microsoft\Windows Defender Advanced Threat Protection

