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