难道DirectorySearcher从目标上限为5000,即使页面大小设置为更大更大、设置为、上限、大小

2023-09-03 01:40:38 作者:红唇吞大枪

时的DirectorySearcher从的findall结果的方法限制在5000结果,即使页面大小设置为大。 这真的好像是,因为无论什么时候我得到完全5000的结果。 这是C#

Is the directorysearcher findall results method capped at 5000 results even if pagesize is set to greater. It really seems to be, because no matter what I get exactly 5000 results. This is C#

推荐答案

首先,这是它限制在一个单一的搜索返回的最大条目数服务器端的设置。默认为1'000。

First of all, it's a server-side setting which limits the maximum number of entries returned in a single search. Default is 1'000.

其次,如果你真的需要枚举超过1'000条目这个限制,你应该看看分页搜索。很简单,将 DirectorySearcher.PageSize 项的值(低于系统限制),例如: 500,你会得到你的结果的500个条目页面。

Secondly, if you really need to enumerate more than this limit of 1'000 entries, you should look into paged searches. Quite simply, set the DirectorySearcher.PageSize entry to a value (less than that system limit), e.g. 500, and you'll get your results in pages of 500 entries.

有多少项目,你会得到总没有限制 - 你可以简单地列举了 DirectorySearcher.FindAll()集合,你应该能够处理任意数量对条目的方式。广告服务器将只是简单的批量在500页的结果 - 一旦你列举了一个页面,下一个将交付

There's no limit on how many entries you'll get in total - you can simply enumerate the DirectorySearcher.FindAll() collection and you should be able to handle any number of entries that way. The AD server will just simply batch up your results in pages of 500 - once you've enumerated one page, the next one will be delivered.

马克·

 
精彩推荐
图片推荐