The directorysearcher is limited to 5000, even if the page size is larger

Is findsearcher's search result method limited to 5000, even if the page size is larger. It really seems because no matter what I get exactly 5,000 results. It with#

+3
source share
3 answers

First of all, this is a server-side parameter that limits the maximum number of records returned in a single search. The default is 1,000.

Secondly, if you really need to list more than this limit of 1,000 entries, you should look for search queries . Just set the DirectorySearcher.PageSizevalue for the record (less than this system limit), for example. 500 and you will get your results on pages of 500 entries.

There is no limit to the number of records you receive in total - you can simply list the collection DirectorySearcher.FindAll()and you can process any number of records in this way. The AD server will simply load your results on pages 500 - as soon as you list one page, the next will be delivered.

Mark

+8
source

Try to do

        mySearcher.SizeLimit = int.MaxValue;
        mySearcher.PageSize = int.MaxValue;

Is there a 5k limit?

+1
source

, Active Directory LDAP .

1000 .

+1
source

Source: https://habr.com/ru/post/1719069/


All Articles