Skip to content

Commit fcbf143

Browse files
authored
Inactive User in Scheduled Jobs
1 parent 7639951 commit fcbf143

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
var activeUser = gs.getProperty('active.run.as.user'); // sys_id of active user
2+
var schJobs = new GlideRecord('sysauto'); // Scheduled jon table, same scripts can be used for sysauto_pa table
3+
schJobs.addEncodedQuery('run_as.active=false');
4+
schJobs.query();
5+
while (schJobs.next()) {
6+
schJobs.setValue('run_as', activeUser);
7+
schJobs.update();

0 commit comments

Comments
 (0)