COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.

I’ve got an error COMException (0x80004005) when called DirectorySearcher.FindAll() and had no idea, why it happened.


Thanks to DirectorySearcher.FindAll() causes Unspecified Error in C# but not in VB.NET discussion I was pointed, that


the error is shown if DirectorySearcher.SearchRoot  path is not valid, e.g. it is “DomainName” instead of “LDAP://DomainName“.


I beleive MS could provide more clear error description.


 

Advertisements