LDAP Group members not importing into servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2018 04:09 AM
Hi Guys,
I have gone through all the scripts mentioned but I am still not able to import group members from AD/LDAP into servicenow Groups using those scripts (i.e OnAfter and OnStart scripts).
Also I need to know what should be the variable that should be set in
ldapUtils.setMemberField('u_member'); // is this the correct field variable that we are using?
ldapUtils.addMembers(source, target);
Note: We are purely using the OOB tables like Sys_user and sys_user_group tables and fields.
Can someone please help me with step by step process of integration to import group members that are added in AD/LDAP to ServiceNow Groups.
Thanks
Anupama.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2018 04:13 AM
Hi,
follow these steps, I've used it few days ago, it worked fine:
In the LDAP OU Definition:
1) Set the RDN to the starting point (like above--note that the "DC=domain,DC=com" is assumed). You may have to increase the Max length for the RDN field if you have a highly nested directory structure.
2) Set the Query field to "sAMAccountName" for Active Directory LDAP servers (if you don't set this properly, you won't get any results)
3) Set the Table field to "Group [sys_user_group]"
4) Set the Filter field to, at the very least, "(objectClass=group)"
After you set up the source and transform maps, save the transform map and create 2 scripts:
On the Transform map, you should at least map "sAMAccountName" and "source".
1) an "onStart" with the script of:
gs.include("LDAPUtils");
var ldapUtils = new LDAPUtils();
ldapUtils.setLog(log);
2) an "onAfter" script of:
ldapUtils.addMembers(source, target);
Hope this will be useful for fit your need.
Please, remember to mark Correct or Helpful if you find my response useful.
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2019 12:33 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
06-04-2020 03:22 PM
Hi Anud,
I was wondering if you got this working as well because I am currently struggling with the same issue.
Thank you.