where to find GlideLDAPGroups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2020 11:53 PM
Hello
We are importing users and groups from ldap. But for some reason the SN ldap group is not populated with users.
I have debugged "LDAPUtils" and can see that: var group = new GlideLDAPGroups(target, geString);
is called with the correct values.
target - the object from sys_user_group
geString - a string with one or more usernames
I could not find "GlideLDAPGroups" to get deeper. It's not a script include !?
Where can I find "GlideLDAPGroups" ?
Sincerely Detlef Biedermann
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 12:07 AM
Hi Detlef,
Sadly, it is stored in the backend "black box" and nothing you can find in the normal UI. Do you have a more specific question? If you do, I can take a look at the backend and the code to see if I can get you an answer. It's not optimal, but I can't share the code with you 😕
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 12:57 AM
Hallo and thanks for answer. I tried to simplify the test case:
#################### Script #############################
var v_gr = new GlideRecord("sys_user_group");
v_gr.get("031b08892fd020109da8532a2799b6a7"); // get object 'ldap_group_itil';
gs.info(v_gr.name);
var geString = 'ldap_itil'; // set user 'ldap_itil'
var group = new GlideLDAPGroups(v_gr, geString);
group.setMembers();
###################### Output ###########################
*** Script: ldap_group_itil
############################################################################
But the user 'ldap_itil' is not assigned to group 'ldap_group_itil'.
User and group exists.
Sincerely Detlef Biedermann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 01:58 AM
Hi Detlef,
So I found the issue. The value for the users is not the user id or so, but the whole DN in the source field on the user record. e.g. "uid=john.doe,ou=People,dc=example,dc=com" or how you LDAP server is configured.
So your example code with joe.doe would look like:
var v_gr = new GlideRecord("sys_user_group");
v_gr.get("031b08892fd020109da8532a2799b6a7"); // get object 'ldap_group_itil';
gs.info(v_gr.name);
var geString = 'uid=john.doe,ou=People,dc=example,dc=com'; // set user 'ldap_itil'
var group = new GlideLDAPGroups(v_gr, geString);
group.setMembers();
If the system property doesn't exist, you can create this "glide.ldap.debug" and set the value to true. Then you will at least get some hints on what can be wrong.
In the example above, I would get that I can't find the john.doe user:
*** Script:
LDAP API - LDAPGroups : Updating membership of group for members : [uid=john.doe,ou=People,dc=example,dc=com]
LDAP API - LDAPGroups : User with DN : uid=john.doe,ou=People,dc=example,dc=commapped to id : null
//Göran
Feel free to connect:
LinkedIn
Subscribe to my YouTube Channel
or look at my Book: The Witch Doctor's Guide To ServiceNow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2020 01:59 AM
to clarify. you shouldn't add "ldap:" in the beginning, since the source field always starts with that, the code has that hardcoded in it.