Suppose you have code like this
try { SearchResult result = searcher.FindOne(); } catch(Exception e) {
Now in Exception you can deal with the LDAP exception type. Here is a list of all LDAP errors.
http://msdn.microsoft.com/en-us/library/aa746530(v=vs.85).aspx
You can determine based on the value of the ADSI error whose type you are getting.
But, according to me, you should give the user a single common error, such as invalid credentials, because the LDAP error is hard to handle.
Greetings. !!
source share