Getting Unknown error (0x80005000) with Directory services in asp .net, IIS 8 environment

574 views Asked by At

Error is happening in the code shown here.

I tried the following based on google research, but still error persists

  1. Ensured "LDAP" is in upper case
  2. Installed II6 meatabase 6.

Error goes off if Application pool or IIS is restarted. But after a day, it comes back. any help is appreciated.

DE = new DirectoryEntry("LDAP://iaai.com/DC=iaai,DC=com");

AdSearch = new DirectorySearcher(DE);
AdSearch.Filter = string.Format("(&(objectClass=user)(objectCategory=user) (sAMAccountName={0}))", sAcct);
AdSearch.PropertiesToLoad.Add("userprincipalname");
AdResult = AdSearch.FindOne();
1

There are 1 answers

2
samwu On

Error 0x80005000 may be caused by permission issues, Plus the parameters for the user name and password should be set to string or "Nothing" and not nothing.

DE = new DirectoryEntry("LDAP://iaai.com/DC=iaai,DC=com", userName, password);