OpenLDAP Active Directory Sample Queries

dashboard

Using the command line ldap tools to browse Active Directory.

These were written when protyping a Mac OS X Dashboard Widget that was a Gemini address book. I ditched it in place of querying a webservice on www.gemini.edu.

Find all users with a surname that starts with k

ldapsearch -x -LLL -E pr=200/noprompt -h xxx.edu -D "testaccount@xxx.edu" -w "xxxpass" -b 
"cn=users,dc=xxx,dc=edu" -s sub "(sn=k*)" mail displayName telephonenumber cn sn

Find all users by displayname kalawe

ldapsearch -x -LLL -E pr=200/noprompt -h xxx.edu -D "testaccount@xxx.edu" -w "xxxpass" -b 
"cn=users,dc=xxx,dc=edu" -s sub "(displayname=*kalawe*)" mail displayName telephonenumber cn sn