Skip to content

Commit cf2bfb2

Browse files
authored
Create Update Inactive Run as Users In Scheduled Jobs
1 parent 7639951 commit cf2bfb2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/* This script will tackel the healthscan finding.
2+
Active user will replace inactibe run as users.
3+
*/
4+
5+
var activeUser = gs.getProperty('active.run.as.user'); // sys_id of active user.
6+
var schJobs = new GlideRecord('sysauto'); // Scheduled jon table, same scripts can be used for sysauto_pa table
7+
schJobs.addEncodedQuery('run_as.active=false');
8+
schJobs.query();
9+
while (schJobs.next()) {
10+
schJobs.setValue('run_as', activeUser);
11+
schJobs.autoSysFields(false);
12+
schJobs.update();
13+
}

0 commit comments

Comments
 (0)