title: Filtering LDAP returned attributes
body: <p>So we have this LDAP query (against OpenLdap)</p>
  
  <pre><code>(&amp;(objectClass=groupOfNames)(member=cn=admin,dc=test,dc=com))
  </code></pre>
  
  <p>The query returns all groups that <strong>admin</strong> is member of. It also returns all other users in those groups. This is an issue when you have +10.000 users that are in the same group. </p>
  
  <p>Is there a way to just return the group names? Like an returned attributes filter?</p>
  
  <p>In Java there is an option like that but I don't know if it just does the query and filters the results clientside, or how to write it as a LDAP query. Example: </p>
  
  <pre><code>String returnedAtts[]={"memberOf","name","mail"};
  search.setReturningAttributes(returnedAtts);
  NamingEnumeration answer = ctx.search(searchBase, "(&amp;(objectClass=user)(sAMAccountName="+username+"))", search);
  </code></pre>
  
  <p>Yes I know. Using <strong>memberOf</strong> would be a more better option. But this LDAP doesn't have that attribute</p>