Solved

ladapsearch- how to search whether an user account already exists in ldap

Posted on 2009-05-06
2
658 Views
Last Modified: 2013-12-24
Hi,

I want to verify if an user account already exists in LDAP or not.
If its local authentication, i would do
# grep <userid> /etc/passwd
and I will know if user acct already exits or not. I am not sure how to find out the same in the case of LDAP.
Please let me know what the command and options would be if I need to verify user acct in LDAP.
Thanks in advance.
0
Comment
Question by:vmwarecv1
2 Comments
 
LVL 14

Accepted Solution

by:
small_student earned 500 total points
ID: 24317656
ldapsearch -x -b uid=mark,ou=people,dc=domain,dc=com "objectclass=*"

where -x means without SASL authentication , if you are using SASL authentication then omit the -x
              -b means your base search , from which part of the directory you are searching

uid will be the user name
ou=people  I am assuming that this is your ou that holds uses, it might be people instead of user ou=people
domain is your top level domain and dc=com is your root domain . if you were xyz.net then it will be dc=xyz,dc=net.


If sucessfull you should get a list of the users attributes on the screen
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question