Massimo Mannini
Massimo Mannini

Reputation: 98

Get all members in a group on Ldap

How i get all members in a group on Ldap with java? I tried:

public List getListAdmin() {
    String base = "cn=admin, ou=group, dc=Google";
    return ldapTemplate.search(base, "(&(objectclass=person)(memberOf=admin))", new UtenteAttributeMapper());
}

Upvotes: 1

Views: 9261

Answers (1)

jwilleke
jwilleke

Reputation: 10986

If you know the group DN, use a filter like:

(member=*)

You may need to verify that "member" is the correct attribute for you LDAP server implementation Some us "uniqueMember" or something else.

memberOf is no supported on all LDAP server implementations.

-jim

Upvotes: 1

Related Questions