VACoder
VACoder

Reputation: 169

Return email only from LDAP query

Let's say I have a query like:

(objectCategory=user) (memberOf=CN=Clients,OU=Mybusiness,DC=mydomain.local,DC=com)

Is there a way to request that only the email of the users AD record be returned?

Thank you!

Upvotes: 1

Views: 4133

Answers (1)

Bernhard Thalmayr
Bernhard Thalmayr

Reputation: 2744

Just define 'mail' as the return attribute of the query.

E.g. using ldapsearch

ldapsearch -h HOST -p PORT -D 'Bind-DN' ..... -b SEARCHBASE "(&(memberOf=CN=Clients,OU=Mybusiness,DC=mydomain.local,DC=com)(objectcategory=user))" mail

Upvotes: 3

Related Questions