Unknown exception (0x8000500) when querying LDAP in .NET

I had a colleague that kept getting errors doing their LDAP queries. I realized that most developers don’t know about the sticky gotcha with the LDAP. Your url has to have the LDAP capitalized. Crazy right?

So your query string:

ldap://ldapServer:1000/ou=internal,ou=people,dc=yours,dc=com

should be

LDAP://ldapServer:1000/ou=internal,ou=people,dc=yours,dc=com

Nice gotcha, right?

Happy Coding!

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.