title: LDAP: Retrieve entries from multiple OUs in one query
body: <p>try to retrieve entries of objectClass 'groupOfNames' from multiple OUs from LDAP. My scheme looks like this:</p>
  
  <pre><code>ou=gp,ou=gruppen,dc=some,dc=my-company,dc=at
  |
  |-ou=99 (objectClass=organizaionalUnit)
     |-cn=admins (objectClass=groupOfNames)
     |-cn=managers (objectClass=groupOfNames)
  |-ou=103 (objectClass=organizaionalUnit)
     |-cn=admins (objectClass=groupOfNames)
     |-cn=managers (objectClass=groupOfNames)
  |-many more OUs
  ...
  </code></pre>
  
  <p>Now i try to create a query with which i can retrieve the admins/managers of the different OUs with one query. Within the CN the admins and managers groups contain the names of users that belong to theses groups. One filter i came up with was:</p>
  
  <pre><code>(cn=admins)
  </code></pre>
  
  <p>This Results in giving me back all the CNs of all OUs:</p>
  
  <p><a href="https://i.stack.imgur.com/A8zmE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A8zmE.png" alt="enter image description here"></a></p>
  
  <p>The search scope is set to complete subtree. How can I change this filter to get only the entries from specific OUs, e.g. ou=212917 and ou=211208, but not from the other OUs? The groups i want to extract in the end look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/aHrTr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aHrTr.png" alt="exampleOfGroupOfNames"></a></p>
  
  <p>Or is there another possibility to realise this? I'm fairly new to LDAP. </p>