I need to retrieve user_ids
(sAMAccountName) of a list of users under a LDAP group. I am using Spring security org.springframework.ldap.core.LdapTemplate
with org.springframework.ldap.core.AttributesMapper
implementation.
My search is:
template.search(base, filter, new AttributesMapperImpl());
My search (member of attribute) returns the name of the users
(CN=Lname\, Fname M,OU=xxx,OU=xxx,OU=Users,OU=xx,DC=xx,DC=xxxxx,DC=xx)
. In order to get the sAMAccountName I have to turn around do another LDAP lookup.
Is there a way I could get sAMAccountName of users using a single lookup?
Thank you!