title: Ldap query on multiple OU
body: <p>I wrote a ldap query class in PHP to authenticate users.
  I need to query ldap server to multiple OU, this is an example:</p>
  
  <pre><code>DC=mydomain,DC=com
      OU=MyBusiness
          CN=MyGroup
  
  DC=mydomain,DC=com
      OU=Users
          CN=Domain Users
  </code></pre>
  
  <p>In this domain, i have two OU, one my custom OU with a group. The other is the standard Windows OU.
  I would like to create a query to get both groups, the one inside OU=Users and the one inside OU=MyBusiness... But seems to be impossibile.
  I tried this connection:</p>
  
  <pre><code>$r=ldap_connect($ldap_host,$ldap_port);
  ldap_bind($r,$user,$passw);
  $domain="OU=MyBusiness,DC=mydomain,DC=com";
  $sr=ldap_search($r, $domain ,"(&amp;(objectClass=user)(sAMAccountName=".$user."))");
  </code></pre>
  
  <p>But gets only MyBusiness's group, I also tried these:</p>
  
  <pre><code>$domain="OU=Users,DC=mydomain,DC=com"; //gets only the other group
  $domain="DC=mydomain,DC=com"; //error
  $domain="OU=*,DC=mydomain,DC=com"; //error
  </code></pre>
  
  <p>But no one works. How can I do?</p>