title: How To Filter And Limit Attributes Of A Group Object In An LDAP
body: <p>I want to get users of a group in an LDAP, with a given filter(Ex: uid="test*") and a limit(only 10 users in the results).</p>
  
  <p>The group object looks like below.</p>
  
  <pre><code>cn=testRole,ou=Groups,dc=WSO2,dc=ORG
  </code></pre>
  
  <p>This object has multiple member attributes representing users of the role "testRole".</p>
  
  <p>Now I'm using the following query to retrieve all the users in the group.</p>
  
  <pre><code>(&amp;(objectClass=groupOfNames)(cn=testRole))
  </code></pre>
  
  <p>And <code>member</code> is set as the returned attribute.</p>
  
  <p>When I run the query, all the 10000 users in the <i>testRole</i> are retrieved(as 10000 member attribute values).</p>
  
  <p>Now,</p>
  
  <ol>
  <li>How do I limit the number of member attribute values?</li>
  <li>How do I filter member attribute values by applying a filter to the value of it's <code>uid</code>?</li>
  </ol>
  
  <p>Thanks in advance!</p>
  
  <p>I tried setting the returned attribute as <code>member;range=0-99</code> but seems like it only works with AD, not with LDAP. I need a solution that would work with LDAP regardlessly it is an AD or not.</p>