C# 不使用LDAP搜索Active Directory
我正在WinXP/Win7/WinServer2003环境中使用VS2008中的C 有没有一种方法可以在不涉及LDAP的情况下搜索active directory 我在Active Directory中创建了用户,但当我使用此C# 不使用LDAP搜索Active Directory,c#,active-directory,C#,Active Directory,我正在WinXP/Win7/WinServer2003环境中使用VS2008中的C 有没有一种方法可以在不涉及LDAP的情况下搜索active directory 我在Active Directory中创建了用户,但当我使用此 DirectorySearcher dirSearcher = new DirectorySearcher( new DirectoryEntry("LDAP://DC=kmmnet,DC=com"), "(
DirectorySearcher dirSearcher = new DirectorySearcher(
new DirectoryEntry("LDAP://DC=kmmnet,DC=com"),
"(objectClass=user)",
new string[] { "sAMAccountName", "displayname", "givenname", "sn" });
foreach (SearchResult s in dirSearcher.FindAll())
{
System.DirectoryServices.PropertyCollection p = s.GetDirectoryEntry().Properties;
}
它找不到某些用户
谢谢
Shawn尝试将PageSize属性的默认值从零上调:
dirSearcher.PageSize = 9000;
PageSize的任何非零值都将导致分页,因此您将收到所有结果(以等于PageSize的批处理方式)
您还可以尝试对搜索进行更多筛选(例如,排除非活动用户等)
并且,对于LDAP查询,没有响应。此限制由域上的管理员控制和设置。我认为默认值是1000