I want to check which user record got inactive in 90 last days using script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 08:29 AM - edited ‎01-09-2025 07:44 AM
I want to check which user record got inactive in 90 last days using script using the history table not from user table filter.
- Labels:
-
Architect

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 09:22 AM
You should be able to do it on any table that has an active flag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 08:44 AM
Hello @SUser1234
You need to visit sys_user table.
Double click on All, a popup will appear. Add the filter condition and click Ok.
You can see the list of records that matches the condition.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 09:03 AM - edited ‎01-06-2025 09:03 AM
Is auditing for the user table enabled in your instance? Normally it is not. Of course, if auditing is not enabled for the user table, you won't be able to query the history/audit table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2025 08:01 AM
Hi Jennifer I want to check by using history table and not query from user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2025 08:58 AM
Hello @SUser1234
Here is the script to meet your requirement:
var grUser = new GlideRecord('sys_user');
grUser.addEncodedQuery('active=false^sys_updated_onRELATIVEGT@dayofweek@ago@90');
grUser.query();
var user = [];
while(grUser.next()){
user.push(grUser.getDisplayValue('name'));
}
gs.print(user);
Result:
Note: The following script displays the user who are inactive and record last updated before 90 days.
Hope this helps!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"
Thank You
Juhi Poddar