Tuesday, December 10, 2019

syspolicy_purge_history failing in SQL 2014

This is very common job which gets created once the server is ready as a free gift from MS to perform cleanup on the server for purging job history.

This job never troubled till recent time but you never know in IT that when the rules get violated and DBA's start scratching their head for finding fix and in a recent scenario similar issue made me put my 100% to troubleshoot and find a fix.

This job works excellent in all versions on SQL server but this has some issue in SQL 2014 and if there is difference in the registry setting and PowerShell execution policy shown below then it would fail. To work this job smoothly both the settings need to be same and for making any registry changes there is no windows reboot required but safer side ensure to have registry backup in case of rollback. 



Once both these values match this job should start working normal with no issues.

Please let me know your feedback on this.