目录搜索器的 findall 结果方法是否限制为 5000 个结果,即使 pagesize 设置为更大.似乎真的是这样,因为无论我得到什么结果都恰好是 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()
集合,并且您应该能够以这种方式处理任意数量的条目.AD 服务器只会简单地将您的结果以 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.
马克
这篇关于即使将 pagesize 设置为更大,directorysearcher 对象是否上限为 5000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!