DirectoryEntry rootEntry = nya DirectoryEntry (”LDAP: ///dc=DOMAIN dc=COM”);
DirectorySearcher dsFindOUs = (rootEntry) nya DirectorySearcher;
dsFindOUs.Filter = ”(objectClass=organizationalUnit)”;
dsFindOUs.SearchScope = SearchScope.Subtree;
foreach (SearchResult resultat i dsFindOUs.FindAll ())
{
Console.WriteLine (resultat. Bana);
}
|