Skip to content

Commit 94e1e20

Browse files
authored
Create Replace Inactive user with active user in scheduled jobs
1 parent 5ca3180 commit 94e1e20

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var activeUser = gs.getProperty('active.user.id'); // property containing active user sys_id
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();
8+
}

0 commit comments

Comments
 (0)