ldap query: ldapsearch for uniqueMember
Asked Answered
W

2

11

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.

Whiffen answered 19/9, 2013 at 8:34 Comment(0)
B
9

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

Bwana answered 19/9, 2013 at 9:31 Comment(4)
Unfortunately, all of those links are dead. :-(Bemused
Edited to link "Search best practices" to archive.org.Horseplay
Middle link is 404.Jorgejorgensen
Updated "Mastering Search Filters" to point to archive.org: web.archive.org/web/20120307075622/https://ff1959.wordpress.com/…Aphasia
S
2

Your query needs to be

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

something like that.

Stratocracy answered 4/5, 2015 at 19:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.