我能够从Active目录中获取计算机名称。
var ldap = new DirectoryEntry("LDAP://mydomain.pk");
var searcher = new DirectorySearcher(ldap) { Filter = "(objectClass=computer)" };
foreach (SearchResult result in searcher.FindAll())
{
string str = result.GetDirectoryEntry().Name.ToString();
Console.WriteLine(str);
}
有没有办法从Active Directory获取IP地址?