LDAP integration creating Duplicate Accounts in User Table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 01:48 AM
We are having LDAP integration in our instance and we are facing the below issue.
When a new user is created in AD, the account gets created in Service now. But when a user account is deactivated and after some time, if the account is re-activated in AD, it is not updating the existing user record in Service now. Instead, it is creating a new user account and hence resulting in duplicate accounts in the User table.
Please provide your suggestions on how I can fix this issue
- Labels:
-
Best Practices
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 01:57 AM
Hi,
have a deep look to the below thread, it might help you to have an idea on how to solve this:
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thank you
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2019 02:30 AM
Any update on this?
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
Thank you
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 02:00 AM
User name field on sys_user table is Uniquely indexed so does not matter whether you set Coalesce on this field or not, system should not create duplicate records.
This being said, I would like to understand what field you are using to set user account, is it email id? Or any other field? If it is email ID and if you have email as coaleasce already set, it might be due the "Query" business rule on sys_user table which must be hiding "inactive" users for your "integration" account ID. In that case I would sugges to grant "admin" rights to your integration account and see if it solves the issues.
Note: Please mark reply as correct if it has answered your question, mark it as helpful if it has guided you towards solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 02:16 AM
Hi Rinadsouza,
Please follow below steps you will get your answer.
--> Create transform Map if not created
--> "Coalesce" should be true to pass unique value to target (user) table.
See screenshot below.
If this is also done then you can write a Onbefor transform map script which will check existing record in user table before inserting in to it.
Script for reference:
//Convert the userAccountControl attribute to a hex value
var ctrl = parseInt(source.u_useraccountcontrol, 10);
ctrl = ctrl.toString(16);
//The relevant digit is the final one
//A final hex digit value of '2' in 'ctrl' means disabled
if (ctrl.substr(-1) == "2") {
target.active = false;
target.locked_out = true;
if (action == 'insert')
ignore = true;
} else {
//Optional: Reactivate and unlock the user account
target.active = true;
target.locked_out = ctrl.substr(-2, 1) == "1";
}
Please hit like or mark correct if this helped you.
Regards
Sandeep