How do you find duplicate user records in ServiceNow that have the same email address

matthew_hughes
Kilo Sage

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.

9 REPLIES 9

RudhraKAM
Tera Guru

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 

Hi, So I've grouped it by Email. So how do I search for "(2)"?

if you are using Windows use cntrl + f and search on the page  if using Mac i think mac button + f   

 

find_real_file.png

Community Alums
Not applicable

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