Ich habe eine Zeit lang in dieser und ich bin immer immer:So stellen Sie eine Verbindung zu Active Directory mit dem Hauptkontext her?
System.DirectoryServices.AccountManagement.PrincipalServerDownException
Was ich denke, bedeutet mein Verbindungsaufbau (Connection String) falsch ist .
Wenn ich "dsquery Server" auf cmd auf dem Computer schreiben, wo das Active Directory ist, erhalte ich:
„CN = DCESTAGIO, CN = Server CN = Default-First-Site-Name, CN = Sites, CN = Configuration, DC = estagioit, DC = local“
ich folgendes Verbinden auf folgende Weise versucht haben:
1:
PrincipalContext thisPrincipalContext = new PrincipalContext(ContextType.Domain, "192.168.56.101", "DC=estagioit,DC=local");
2:
PrincipalContext thisPrincipalContext = new PrincipalContext(ContextType.Domain, "192.168.56.101/DC=estagioit,DC=local");
3:
PrincipalContext thisPrincipalContext = new PrincipalContext(ContextType.Domain, "192.168.56.101/CN=DCESTAGIO,DC=estagioit,DC=local");
4:
PrincipalContext thisPrincipalContext = new PrincipalContext(ContextType.Domain, "192.168.56.101/CN=DCESTAGIO,CN=SERVERS,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=estagioit,DC=local");
5:
PrincipalContext thisPrincipalContext = new PrincipalContext(ContextType.Domain, "LDAP://192.168.56.101/CN=Users,DC=estagioit,DC=local");
Und einige andere Möglichkeiten ...
Irgendwelche Ideen, was falsch ist und wie ich diese Verbindung herstellen kann?
PS: Die IP ist korrekt gesehen, wie ich es zum Pingen verwendet habe und es funktioniert.
PSS: Ich brauche das wirklich so schnell wie möglich, wenn Sie irgendwelche Vorschläge haben, sind sie alle willkommen.
Dank du hast mich gerettet wirklich ein Mann! ;) –
Ich habe eine relevante Frage. Ich hoffe du kannst mir helfen: http://stackoverflow.com/questions/42971315/finding-active-directory-users-from-2-ou – user2931442