Eric Brown - Cal
Eric Brown - Cal

Reputation: 14399

Ad DirectorySearcher limited to 1k rows

IS there any way to get the AD searcher to return more than 1k rows, or to get it to return the results in 1k pages?

I need to do a test on all 45k users in our domain.

Code looks like this:

DirectorySearcher search = new DirectorySearcher( entry );

    search.Filter = "(&(objectClass=user))";             
    search.SizeLimit = 100000;//ignored if over 1000            

    foreach ( SearchResult result in search.FindAll() )

Thanks,

Eric-

Upvotes: 1

Views: 242

Answers (1)

Shoban
Shoban

Reputation: 23016

Use PageSize for results which may be more than 1000. Example :

Use search.PageSize = 500;

Source

Upvotes: 3

Related Questions