Hi all
I want use ldapsearch to query a Active Directory Server. I am use this :
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password
This command bring me all entries.
I like filter only two attributes: cn and mail.
Is there a way to do this???
Thanks
Gilberto Nunes Ferreira TI Selbetti Gestão de Documentos Telefone: +55 (47) 3441-6004 Celular: +55 (47) 8861-6672
"Bendita a nação cujo Deus é o SENHOR!" 99 <><
On 13/11/2009 19:41, Gilberto Nunes wrote:
Hi all
I want use ldapsearch to query a Active Directory Server. I am use this :
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password
This command bring me all entries.
I like filter only two attributes: cn and mail.
Is there a way to do this???
To display only two attributes: just add them to the end of the command, like :
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password cn mail
By the way, "filter" refers to the search filter, '(|(objectClass=person)(objectClass=user))' in this case.
Jonathan
On Fri, 13 Nov 2009, Gilberto Nunes wrote:
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password
This command bring me all entries.
I like filter only two attributes: cn and mail.
I'm going off on a very dangerous limb, but I believe "entries" and "filter" are being lost in translation here (they mean something very specific in the context of LDAP). I believe what you want is to request the attributes "cn" and "mail" only. For that please try:
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password cn mail
and let the list know if that's what you want.
Gilberto Nunes wrote:
I want use ldapsearch to query a Active Directory Server. I am use this :
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password
This command bring me all entries.
I like filter only two attributes: cn and mail.
Please see:
man 1 ldapsearch
=> Just append the attributes wanted to the command line.
ldapsearch -LLL -x -b dc=selbetti,dc=local -H ldap://host -D proxy_user '(|(objectClass=person)(objectClass=user))' -w password cn mail
Ciao, Michael.
openldap-software@openldap.org