Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ldap query: ldapsearch for uniqueMember

How can I search for a uniqueMember in an objectClass groupOfUniqueNames within OpenLdap?

dn: cn=group,dc=example,dc=com
objectclass: groupOfUniqueNames
cn: group
uniquemember: uid=member1
uniquemember: uid=member2

I've tried the following with no result:

ldapsearch -x -b dc=example,dc=com "(uniqueMember=uid=member1)"

Pls help me.

like image 903
Christoph Avatar asked Sep 19 '13 08:09

Christoph


2 Answers

The assertion used in this filter is probably not the full DN: "(uniqueMember=uid=member1)". uniqueMember has DN syntax, therefore, the value used in the assertion must be a DN, for example: (uniqueMember=uid=member1,ou=people,dc=example,dc=com).

see also

  • LDAP: Mastering Search Filters
  • LDAP: Search best practices
  • LDAP: Programming practices
like image 50
Terry Gardner Avatar answered Nov 21 '22 10:11

Terry Gardner


Your query needs to be

"(&(objectclass=groupOfUniqueNames)(uniqueMember=uid=member1,ou=people,dc=example,dc=com))"

something like that.

like image 31
santino Avatar answered Nov 21 '22 08:11

santino