Active Directory Users and Groups Limit (1000)

Active Directory LDAP queries are limited to returning 1000 objects (users and groups). Here are some suggestions to get around the query limit.

It might be possible to change this server side, as suggested in this link:

One other possible way to override this value is to look at a class called AdsiDataFactory in EPiServer.Security namespace. There is a method called FindAll()

public override IList<DirectoryData> FindAll(string filter, SearchScope scope, string sortByProperty)

Within this method, there is a property called PageSize:

directorySearcher.PageSize = this.PageSize;

You can override the behavior of the base class by writing your own class inheriting from this and change directorySearcher.PageSize to be set to some other value in order to return more than 1000 objects. This blog post offers an example:, like setting PageSize to something like Int32.MaxValue instead of this.PageSize (which seems to default to 1000).

There isn't a simple web.config way to do this, but overriding the behavior of that base class might do the trick.

Another blog post reference: