LDAP

Using Ldapsearch

ldapsearch -D 'uid=dmarti06,cn=users,dc=seattlecentral,dc=edu' -H 'ldaps://macldap1.seattlecentral.edu:636' -x -W -b 'dc=seattlecentral,dc=edu' filter thing-what-u-searching-for ...

filter e.g. '(uid=dmarti06)'
thing-what-u-searching-for e.g. 'uid'

Note the single-quotes around the filter. Otherwise the parenthesis get processed by the shell.

Filters

These are wacky. Greater-than and less-than don't seem to work (at least not on uidnumber). They'd look like "uidnumber>=5" if they did work.

Here's some better ones:

(uid=a*)             #everyone with uid starting with 'a'
(|(uid=a*)(uid=b*))  #starting with a or b

Specifying the ca cert file

The ca file is determined by ~/.ldaprc. A line like " TLS_CACERT=path_to_file "

Sorting

So, I can't filter uidnumber with gt/lt. I can, however sort the entire output. Just add "-S uidnumber" in there somewhere.


CategoryNotes

ldap (last edited 2008-03-30 15:30:42 by dmartin)