I am using Spring Data LDAP to return all members of a particular AD group . The AD group has more than 40,000 members . When running the below query , I am only able to retrieve 6000 members . How do I get the remaining members or iterate to next batch .
public List<User> getMembersOfADGroup() throws NamingException {
String base = "DC=xxxx,DC=com";
String filter = "(memberOf=CN=g.xxxxx,OU=Dynamic,OU=Groups,OU=Corp,OU=Common,DC=xxxx,DC=com)";
LdapQuery ldapQuery = LdapQueryBuilder.query().base(base).searchScope(SearchScope.SUBTREE)
.attributes(AD_SAMACCOUNTNAME, AD_SN, AD_GIVENNAME, AD_MAIL).filter(filter);
return ldapTemplate.search(ldapQuery, new UserAttributesMapper());
}