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.

 

posted @ Monday, December 19, 2005 10:58 AM

Print

Comments on this entry:

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

Left by Dave Markle at 4/17/2006 4:37 AM
Gravatar
Thanks, man, you just saved me a BOATload of time!

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

Left by glgdf at 3/9/2007 2:08 AM
Gravatar
(it's just crappy code again)

i got the same erro when using

ldap://

instead of

LDAP://

geez!!

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

Left by glgdf at 3/9/2007 2:10 AM
Gravatar
I wonder from what planet ms digged up these coders & testers


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

Left by Brendan at 6/22/2008 7:58 PM
Gravatar
Another thanks from me!
I had same issue: Not putting "LDAP://server/" at the front of my path.

I agree the errors suck. Every time .net needs to drop out to a com component things get nasty and it feels like 1990s microsoft all over again.

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

Left by ADCoder at 12/17/2008 10:23 AM
Gravatar
Truck loads of thanks to you buddy. Was pulling my hair trying to find out what the problem was with my query. Thanks for the great pointer !!!!!

This did not work :
DirectoryEntry de = new DirectoryEntry("LDAP://10.155.242.24/", "user", "password");

This worked !!!!!:
DirectoryEntry de = new DirectoryEntry("LDAP://10.155.242.24", "user", "password");

Notice I removed the "/" at the end of the IP. The "/" was the problem.

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

Left by Abercrombie at 1/8/2009 2:30 AM
Gravatar
I'm with the other folks in saying thanks. I found your page 'cause I had the same issue. It's case sensitive too because the underpinnigs are C, - based..... as in C, C++ probably with Option Explicit On settings....

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

Left by web development company at 8/14/2009 11:31 AM
Gravatar
Ah , Thanks it worked like a charm, you saved my day
I used
DirectoryEntry de = new DirectoryEntry("LDAP://10.155.242.24", "user", "password");

and it worked

Your comment:



 (will not be displayed)


 
 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345