1847195 Members
4603 Online
110263 Solutions
New Discussion

LDAP

 
atul.kaggarwal
Contributor

LDAP

can some one give some examples of how to use ldapsearch command (syntax)?
3 REPLIES 3
Peter Godron
Honored Contributor

Re: LDAP

Hi,
have you look at the (SUN) man pages ?

For example:
http://www.cs.biu.ac.il/cgi-bin/man?ldapsearch+1

If this does not help, please specify more detailed what you are having problems with.

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward the answers given to your questions.
So far you have not awarded any points !
Ivan Ferreira
Honored Contributor

Re: LDAP

The ldapsearch is pretty simple, these are examples:

Search for all objects in the groups ou:

ldapsearch -x -b ou=groups,dc=example,dc=com,dc=py \
-D "cn=Directory Manager" -W 'objectclass=*'

Search for user id jperez in ou people:

ldapsearch -x -s one -b ou=people,dc=example,dc=com,dc=py \
-D "cn=Directory Manager" -W 'uid=jperez'

Search for all entries of class persons that does not has a telephonenumber associated:

ldapsearch -x -s one -b ou=people,dc=example,dc=com,dc=py \
-D "cn=Directory Manager" -W -H ldaps://fds1.example.com.py \
'(&(objectclass=person)(!(telephonenumber=*)))'

-x : Simple authentication
-s : Scope, "one, base, sub"
-b : Search base
-D : Bind DN
-H : Server URI (ldaps for SSL access)

Search filter:
AND search (&(attribute)(attribute))
OR search (|(attribute)(attribute))
NOT search (!(attribute))
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Yogeeraj_1
Honored Contributor

Re: LDAP

hi,

if you are using oracle, one example would be:
$ORACLE_HOME/bin/ldapsearch -p oid_port -h oid_hostname -D "cn=orcladmin"
-w orcladmin_password -b "orclresourcename=schema_name, orclreferencename=metadata_rep_global_db_name, cn=ias infrastructure databases,
cn=ias, cn=products, cn=oraclecontext" -s base "objectclass=*"
orclpasswordattribute


hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)