C#获取AD用户信息
DirectoryEntry de = new DirectoryEntry("LDAP://" + "域名", "用户名", "密码", AuthenticationTypes.Secure);
DirectorySearcher ds = new DirectorySearcher();
ds.SearchRoot = de;
ds.Filter = ("(objectClass=user)"); group是组
foreach (SearchResult result in ds.FindAll())
{
string name = result.GetDirectoryEntry().Name.ToString();
Page.Response.Write(name);
}
作者:Bychentufeiyang
补充:软件开发 , C# ,