DirectoryEntry rootEntry = novo de DirectoryEntry (“LDAP: ///dc=DOMAIN, dc=COM”);
dsFindOUs de DirectorySearcher = DirectorySearcher novo (rootEntry);
dsFindOUs.Filter = “(objectClass=organizationalUnit)”;
dsFindOUs.SearchScope = SearchScope.Subtree;
foreach (resultado de SearchResult em dsFindOUs.FindAll ())
{
Console.WriteLine (resultado. Trajeto);
}
|