Ich habe den Active Directory-Domänennamen "ADDOMAIN2" mit dem Gruppennamen "CommonUsers" mit 8 Benutzern erstellt. Wenn ich jedoch eine Verzeichnissuche für Benutzer in der Gruppe "CommonUsers" durchführe, wird kein Ergebnis zurückgegeben. Ihr CodeBenutzer aus der Verzeichnisgruppe "Active Directory"
DirectorySearcher searcher = new DirectorySearcher();
DirectoryEntry directoryEntry = new DirectoryEntry(string.Format("LDAP://{0}", "ADDOMAIN2"), "Administrator", "[email protected]$w0rd");
string dnPath = directoryEntry.Properties["distinguishedName"].Value.ToString();
// string path = string.Format("LDAP://{0}/{1}{2}", "ADDOMAIN2", "", dnPath);
string path = "LDAP://ADDOMAIN2/CN=CommonUsers,DC=ADDomain2,DC=ADDomain01,DC=WaveDomain";
directoryEntry.Path = path;
searcher.SearchRoot = directoryEntry;
searcher.Filter = "(&(objectCategory=person)(objectClass=user))";
SearchResultCollection rs = searcher.FindAll();
Irgendeine Idee, was hier falsch ist?
Thanx
Haben Sie meine Antwort überprüft? War es hilfreich? Jeglicher Kommentar? –