novell.directory.ldap.netstandard MaxResults

编程入门 行业动态 更新时间:2024-10-15 20:25:17
本文介绍了novell.directory.ldapstandard MaxResults的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用核心项目中的novell.directory.ldapstandard查询活动目录.

I am querying my active directory using novell.directory.ldapstandard from my core project.

最多只能带回1000个用户,我知道这是因为服务器上的PageSize设置为1000,如何获取带回所有活动目录用户的代码? -我正在使用异步搜索方法.

It is only bringing back a maximum of 1000 users, I know this is because the PageSize on the server is set to 1000, how can I get the code to bring back all active directory users? - I am using the async search method.

string ldapHost = ""; int ldapPort = ; string loginDN = ""; string password = ""; string searchBase = ""; string searchFilter = ""; string[] attributes = new string[] { "givenName", "sn"}; LdapConnection ldapConn = new LdapConnection(); ldapConn.Connect(ldapHost, ldapPort); ldapConn.Bind(loginDN, password); LdapSearchQueue queue = ldapConn.Search(searchBase, LdapConnection.SCOPE_SUB, searchFilter, attributes, false, (LdapSearchQueue)null, (LdapSearchConstraints)null); LdapMessage message; int i = 1; while ((message = queue.getResponse()) != null) { if (message is LdapSearchResult) { LdapEntry entry = ((LdapSearchResult)message).Entry; LdapAttributeSet attributeSet = entry.getAttributeSet(); Console.WriteLine(i + " " + attributeSet.getAttribute("givenName")?.StringValue + " " + attributeSet.getAttribute("sn")?.StringValue); i++; } } ldapConn.Disconnect();

推荐答案

在LDAP中,您需要使用页面结果控件.

In LDAP terms, you need to use the page result control.

在C#中,这个问题似乎可以解决: stackoverflow/a/90668/7990687

In C#, this question seems to cover it : stackoverflow/a/90668/7990687

更多推荐

novell.directory.ldap.netstandard MaxResults

本文发布于:2023-11-17 02:53:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608543.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:directory   novell   ldap   MaxResults   netstandard

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!