How do you find duplicate user records in ServiceNow that have the same email address
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2019 06:18 AM
Hi,
We've discovered an issue in Servicenow if a user has more than one ID with the same email address, it stops from receiving emails about requests pending their approval.
So what I'm wanting to do is find a way of searching for all users that have the same email address in more than one user record. I was just wondering how this can be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2019 06:39 AM
just open sys_user table group by email and on the page search for "(2)" or download that to excel to get all the list and do the same search and fix the emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2019 07:28 AM
Hi, So I've grouped it by Email. So how do I search for "(2)"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2019 07:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2019 06:49 AM
Hi Matthew,
You can go to sys_user table , from list view right-click on email->group by to check if any email id has been used more than once.
Alternatively you can use this background Script:
var gaDupCheck1 = new GlideAggregate('sys_user');
gaDupCheck1.addQuery('active','true');
gaDupCheck1.addAggregate('COUNT', 'email');
gaDupCheck1.groupBy('email');
gaDupCheck1.addHaving('COUNT', '>', 1);
gaDupCheck1.query();
while (gaDupCheck1.next()) {
gs.print(gaDupCheck1.email);
}
Please mark as correct/helpful if this helps!
Thanks
DR