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

query Active Directory



I am querying AD to get the first proxyaddresses:smtp field with only
the username but it is giving me lots of other information that I
don't really need. I was wondering if it is be possible to filter the
query in slapd.conf to give me what I need.

Here's my slapd.conf

Allow bind_v2
access to dn.base=""
by * read
access to *
by * read
database ldap
suffix "dc=ad3,dc=merog,dc=org"
uri "ldap://ad3.merog.org";
query_filter=(PROXYADDRESSES :smtp:%s@*)
cachesize 10000
sizelimit unlimited

I am querying for PROXYADDRESSES which comes like this:
PROXYADDRESSES: smtp:username@merog.org - I only want the "username"
bit.

Here's my query:

ldapsearch -x -h ad3.merog.org -b "dc=ad3,dc=merog,dc=org" cn="user name"

I don't want to use any sed, awk script to achieve the result. Just
would like to use openldap itself if that's at all possible.

Thanks for any help.