即使将 pagesize 设置为更大,directorysearcher 对象是否上限为 5000
- 作者: mountainsea
- 来源: 51数据库
- 2022-10-21
问题描述
目录搜索器的 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.
马克
- C#通过fleck实现wss协议的WebSocket多人Web实时聊天(附源码)
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源
