diff --git a/Server-Side Components/Background Scripts/Silent update on GlideRecord/README b/Server-Side Components/Background Scripts/Silent update on GlideRecord/README new file mode 100644 index 0000000000..240c3e6653 --- /dev/null +++ b/Server-Side Components/Background Scripts/Silent update on GlideRecord/README @@ -0,0 +1,3 @@ +This Script will help to improve healthscan score. +Inactive users set as "Run as" in scheduled jobs are flagged as health scan findings. +This script will update the inactive users will active user set in system proprty. diff --git a/Server-Side Components/Background Scripts/Silent update on GlideRecord/Update Inactive User in Scheduled Jobs b/Server-Side Components/Background Scripts/Silent update on GlideRecord/Update Inactive User in Scheduled Jobs new file mode 100644 index 0000000000..2c19abff43 --- /dev/null +++ b/Server-Side Components/Background Scripts/Silent update on GlideRecord/Update Inactive User in Scheduled Jobs @@ -0,0 +1,9 @@ +var activeUser = gs.getProperty('active.run.as.user'); // sys_id of active user +var schJobs = new GlideRecord('sysauto'); // Scheduled jon table, same scripts can be used for sysauto_pa table +schJobs.addEncodedQuery('run_as.active=false'); +schJobs.query(); +while (schJobs.next()) { + schJobs.setValue('run_as', activeUser); + schJobs.autoSysFields(false); + schJobs.update(); +}