c# - Keep getting exceptions using PrincipalContext from the System.DirectoryServices.AccountManagement assembly -


The system. Use Directory Services. Account management assembly

I am using Constructor

  Principal Contact Reference = New Principal Contestex (ContaxType Dammen, "Masserver .Des.com Com", "LDAP: // Ou = the user, dc = maiser, dc = ds, dc = com ", edusmen, password);  

I can call context.ValidateCredentials (adusername, password, ContextOptions.ServerBinding) and gives it correct.

As soon as I call UserPrincipal.FindByIdentity (Reference, Identity Type. SamAccountName, Username);

I get different principal operation exceptions Sometimes "the server has sent a referrer" This is an unknown error for the second time (0x80005000)

I am using these charges because one The same domain does not have a question in the same domain that the user running the program is in.

Anyhow

The container string you pass through Remove LDAP: // from

After that it should work fine.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -