来自活动领域的所有用户

编程入门 行业动态 更新时间:2024-10-27 12:41:19
本文介绍了来自活动领域的所有用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好! 在这里,我创建代码以从Active Directory中获取所有用户 我不知道那里出了什么问题

hi to all! Here I create code to get all users from Active Directory I dont know whats the problem there

try { string path = "LDAP://usihgdgfui"; string filter = "(&(objectCategory=person))"; string[] propertiesToLoad = new string[1] { "name" }; using (DirectoryEntry root = new DirectoryEntry(path, "xx\\xxxx", "xxxx")) using (DirectorySearcher searcher = new DirectorySearcher(root, filter, propertiesToLoad)) using (SearchResultCollection results = searcher.FindAll()) { foreach (SearchResult result in results) { string name = (string)result.Properties["name"][0]; comboBox1.Items.Add(name); } } } catch { }

推荐答案

未获得您期望的结果吗?得到奇怪的偶数个结果?像是有一些内置的限制吗? 查看searcher.PageSize属性. 将其设置为25000,然后看看会发生什么. Not getting as many results as you expect? Getting a strangely even number of results? Like there''s some sort of built-in limit? Look at the searcher.PageSize property. Set it to, say 25000 and see what happens.

更多推荐

来自活动领域的所有用户

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

发布评论

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

>www.elefans.com

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