- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 01:56 AM
Hi Team ,
when user is not using service now Account after 90 Days , the account will be deactivate from service now and also trigger the notification .
so,i was stuck in Scheduled jobs user is deactivate form user table but notification is not trigger .please look in below script .
1.Written Notification
2.Event Registry
var user = new GlideRecord('sys_user');
user.addEncodedQuery("active=true^last_login<=javascript:gs.beginningOfLast90Days()");
//user.addEncodedQuery("active!=false^name=user, test");
user.query();
while(user.next())
{
gs.eventQueue("logout_user_90days",user,user.email);
user.active = 'false';
user.locked_out = 'true';
user.update();
}
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 02:22 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 05:08 AM
Hi Haribabu,
Did you get the notification triggered for inactive user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 06:50 AM
No Not yet .
Can you help on that .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2019 06:57 AM
I have asked since you have marked this question already as accepted answer.
Check my earlier comment where i have given the suggestion and why the notification might not be coming.
Mark the comment as helpful and correct answer if it answers your question.