现在的位置: 首页 > 综合 > 正文

NET AD查询

2012年01月08日 ⁄ 综合 ⁄ 共 351字 ⁄ 字号 评论关闭

由于工作需要,我需要遍历AD进行一些同步操作.

遍历的代码如下.

DirectorySearcher adSearcher = new DirectorySearcher(); Dictionary userConfigs = new Dictionary(); adSearcher.SearchRoot = new DirectoryEntry("LDAP://OU=组织架构,DC=****,DC=com", "****", "****"); adSearcher.Filter = "(objectclass=user)";

但是总是不能正确的返回所有的结果,而只返回1000个用户

解决方案是:
adSearcher.SizeLimit = Int32.MaxValue;
adSearcher.PageSize = Int32.MaxValue;

抱歉!评论已关闭.