Is the directorysearcher object capped at 5000 even if pagesize is set to greater(即使将 pagesize 设置为更大,directorysearcher 对象是否上限为 5000)
问题描述
目录搜索器的 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:即使将 pagesize 设置为更大,directorysearcher 对象是


基础教程推荐
- 我什么时候应该使用 GC.SuppressFinalize()? 2022-01-01
- 当键值未知时反序列化 JSON 2022-01-01
- 从 VB6 迁移到 .NET/.NET Core 的最佳策略或工具 2022-01-01
- C# - 如何列出发布到 ASPX 页面的变量名称和值 2022-01-01
- 如何使用OpenXML SDK将Excel转换为CSV? 2022-01-01
- 创建属性设置器委托 2022-01-01
- Page.OnAppearing 中的 Xamarin.Forms Page.DisplayAlert 2022-01-01
- C# - 将浮点数转换为整数...并根据余数更改整数 2022-01-01
- 覆盖 Json.Net 中的默认原始类型处理 2022-01-01
- 使用 SED 在 XML 标签之间提取值 2022-01-01