[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: searching for all entries with a particular dn

Bernhard Erdmann writes:
> I'm looking for a search filter syntax returning all entries grouped by 
> a particular dn.
> Example: you have all your relatives grouped in 
> ou=family,ou=private,ou=groups,dn=domain,dn=org
> How do you search for the email addresses of them?

ldapsearch ... -b "ou=family,ou=private,ou=groups,dn=domain,dn=org" \
   -s sub (or maybe -s one, depending on your tree structure) \
   "(objectClass=*)" mail

> (ou=family) does not return any entry:

Because an entry's DN - and its contents - is not part of the entry.
Just like a UNIX file's name does not occur inside the file.

An entry's RDN - i.e. the part of the DN before first comma - must match
attributes in that entry, but this has nothing to do with the contents
of entries below that entry.

As your search result demonstrates.

> $ ldapsearch -x -h ldap -b dc=berdmann,dc=de "(ou=family)" mail
> (...)
> dn: ou=family,ou=private,ou=groups,dc=berdmann,dc=de