Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7919409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:51:17+00:00 2026-06-03T15:51:17+00:00

According to these posts in the php.net manual it should be possible to supply

  • 0

According to these posts in the php.net manual it should be possible to supply multiple DNs for ldap_search().

However, I can’t get the below implementation to work:

$dn[] = 'ou=Red,ou=Teams,ou=Users,dc=example,dc=org';
$dn[] = 'ou=Green,ou=Teams,ou=Users,dc=example,dc=org';
$dn[] = 'ou=Blue,ou=Teams,ou=Users,dc=example,dc=org';

$query = ldap_search($conn, $dn, $filter, $attrs);

Everything is fine when passing through any of the individual DN strings, but supplying an array will error with message: ‘No such object’.

An obvious work around for this is to loop over my DN array to fire off separate queries and push everything in to one array. I’d like to avoid having to do that, since I’m bringing back 8000+ objects in one DN (Paginated – Example 2) and ~300 in each of the other two.

Is it actually possible to search multiple DNs?
Perhaps special syntax (symbol/character) within the single DN string?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:51:19+00:00Added an answer on June 3, 2026 at 3:51 pm

    Search requests must contain a minimum the following parameters:

    • the base object at which the search starts (no objects above the base objects are returned)
    • the scope of the search: base is the base object itself, one is the base object and
      one level below the base object, sub is the base object and all entries below the base object.
    • a filter which limits the entries returned to those entries which match the assertion in the
      filter

    A list of attributes can also be supplied, though many, but not all, LDAP APIs will request all
    user attributes if none are supplied in the search request.

    In the case listed, set the base object to ou=users,dc=example,dc=com and use an appropriate
    filter. If the LDAP client must restrict the returned entries to entries that are subordinate
    to ou=red, ou=green, or ou=blue it may be possible to use a compound extensible match filter
    like (&(objectClass=inetOrgPerson)(|(ou:dn:=red)(ou:dn:=green)(ou:dn:=blue))) – use the correct object
    class if the data does not use inetOrgPerson. All LDAP-compliant servers support extensible
    match filters, but non-compliant servers may not support this standard filter.

    It is not possible to use multiple base objects, the scope parameter defines how many subordinate
    levels, if any, are examined below the base object.

    see also

    • LDAP: Mastering Search Filters
    • LDAP: Search best practices
    • LDAP: Programming practices
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can I execute a block of code exactly once in PHP?
According to this post , there's a separate DatePicker control in .net 4. I've
According to the text in avcodec.h file, there are some decoders may support multiple
In PHP it's possible to have arrays in $_GET , $_POST , $_COOKIE ,
First issue, where is it suppose to be? Accordint to php.net Files will, by
I have previously only made web applications in Asp.Net MVC, and there you can
So I have a script (written in PHP) that posts the user input of
So I have a script (written in PHP) that posts the user input of
I am releasing things but the memory seems to still be there according to
According to this there are four size screens, small, normal, large and xlarge. So

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.