从Active Directory获取IP地址

时间:2017-10-23 05:04:13

标签: c# .net active-directory

我能够从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地址?

0 个答案:

没有答案