I have been for a while and I always get:
System.DirectoryServices.AccountManagement.PrincipalServerDownException
I think my connection setup (connection string) is incorrect.
When I write "dsquery server" in cmd on the computer where I get Active Directory:
"CN = DCESTAGIO, CN = SERVERS, CN = Default-First-Site-Name, CN = Sites, CN = Configuration, DC = estagioit, DC = local"
I tried the following connection in the following ways:
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");
And some other ways ...
Any ideas on what's wrong and how can I make this connection work?
PS: ip correctly shows how I used it for ping, and it works.
PSS: I really really need this job as soon as possible, if you have any suggestions, they are all welcome.