即使将 pagesize 设置为更大,directorysearcher 对象是否上限为 5000

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Finding Active Directory users from 2 OU(从 2 个 OU 中查找 Active Directory 用户)
How to set a binary attribute when using a AccountManagement Extension Class?(使用 AccountManagement 扩展类时如何设置二进制属性?)
How to check AD user credentials when the user password is expired or quot;user must change password at next logonquot;(如何在用户密码过期或“用户下次登录时必须更改密码时检查 AD 用户凭据)
Getting last Logon Time on Computers in Active Directory(在 Active Directory 中的计算机上获取上次登录时间)
customer-configurable asp.net web site security for fine-grained control of page and button access(客户可配置的 asp.net 网站安全性,用于对页面和按钮访问进行细粒度控制)
Active Directory - Roles of a user(Active Directory - 用户的角色)