Using System.DirectoryServices.AccountManagement assembly.
I am using the constructor
PrincipalContext context = new PrincipalContext(
ContextType.Domain,
"myserver.ds.com",
"LDAP://OU=the-users,DC=myserver,DC=ds,DC=com",
adusername,
password);
I can call context.ValidateCredentials(adusername, password, ContextOptions.ServerBinding)
and it returns true.
As soon as I call UserPrincipal.FindByIdentity(context, IdentityType.SamAccountName, username);
I get various PrincipalOperationException. Sometimes is a "server sent a referrer". Other times it is Unknown error (0x80005000)
I'm using these overloads because the server in question in not in the same domain that the user running the program is in.
Anyhow, how to fix this and possibly some enlightenment to the procedure arguments would be most appreciated.
Thanks in Advance.