query to count number of users

Shalika
Tera Expert

Query to find the number of users in sys_user table

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

something like this

var rec = new GlideRecord('sys_user');
rec.query();
var totalUsers = rec.getRowCount();

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Jaspal Singh
Mega Patron
Mega Patron

Script by Ankur should help but why do you need this? Can't it be checked in User table directly?

Musab Rasheed
Tera Sage
Tera Sage

Seems to be a duplicate question, have provided solution here, did you get chance to see this.?

https://community.servicenow.com/community?id=community_question&sys_id=6f27e4c7db27c110770be6be13961988

Please hit like and mark my response as correct if that helps
Regards,
Musab