LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-15-2010, 05:06 PM   #1
frozenQueue
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Rep: Reputation: 0
LDAP search


Hi. According to my boss, I need to become an openLDAP guru in about two hours. So I might be asking a lot of LDAP questions.

First question: When using ldapsearch, what is the syntax if you want more than one filter applied? For example, if

Code:
  ldapsearch -h ldap.example.com -b dc=example,dc=com "(sn=Harold)"
give me one set of results and

Code:
  ldapsearch -h ldap.example.com -b dc=example,dc=com "(givenName=Frank)"
gives me another set, how do I combine the two to get only the results that match both? I tried just putting both filters on the command-line one-after-the-other, but that doesn't produce the results I expect.
 
Old 09-15-2010, 05:17 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
"and" them.

Code:
 "(&(sn=Harold)(givenName=Frank))"
http://www.zytrax.com/books/ldap/apa/search.html

Last edited by AlucardZero; 09-15-2010 at 05:18 PM.
 
Old 09-15-2010, 05:46 PM   #3
frozenQueue
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
"and" them.

Code:
 "(&(sn=Harold)(givenName=Frank))"
http://www.zytrax.com/books/ldap/apa/search.html
Thanks!

Wow, that sure is some very /natural/ syntax they picked there. It's a wonder we're not all LDAP gurus.
 
  


Reply



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
ASSP LDAP search errors tekhead2 Linux - Server 0 06-30-2009 04:39 PM
LDAP command line search. knockout_artist Linux - Newbie 1 02-12-2009 11:40 AM
LXer: Use Perl grep tool for custom LDAP search capability LXer Syndicated Linux News 0 02-24-2007 03:46 AM
perl and net::ldap how to return dn from a search jonlake Programming 2 02-24-2006 12:46 PM
LDAP bind instead of search request corbis_demon Linux - Newbie 0 07-02-2004 11:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:49 PM.

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
Open Source Consulting | Domain Registration