LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-24-2012, 08:34 AM   #1
nano101
LQ Newbie
 
Registered: Apr 2011
Posts: 6

Rep: Reputation: 0
ldapsearch help


Hi.

I would need to be able to verify if a user exists on an active directory server.

I want to use ldapsearch just to verify IF the user is a valid user and has an account on AD, does anyone know the correct syntax to this this query?

Any help or pointers would be much appreciated.
 
Old 04-24-2012, 08:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977
Depends what exact answer you want to get, but I would say that you simply need to bind to the ldap services on AD as that user, rather than actually looking for that user.

that's pretty simple:

ldapsearch -x -h 12.34.56.78 -D cn=username,ou=folder1,ou=folder2,dc=domain,dc=com -w p4ssw0rd '(cn=username)'

that's it really, if you get the user account back, you successfully bound as that user.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ldapsearch | ldapmodify eantoranz Linux - Software 1 01-28-2013 09:33 PM
[SOLVED] ldapsearch in variable s_linux SUSE / openSUSE 3 01-06-2012 03:17 PM
Trouble with ldapsearch and AD rcrook89 Linux - Newbie 3 06-01-2011 07:26 PM
ldapsearch query saravana_05 Linux - Newbie 1 07-09-2009 02:06 AM
ldapsearch cmontr Programming 4 11-15-2007 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration