Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

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 on Monday, December 19, 2005 10:58 AM .Net Framework , Active Directory | Back to top


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

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting Gravatar...
Thanks, man, you just saved me a BOATload of time!
Left by Dave Markle on Apr 17, 2006 4:37 AM

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting Gravatar...
(it's just crappy code again)

i got the same erro when using

ldap://

instead of

LDAP://

geez!!
Left by glgdf on Mar 09, 2007 2:08 AM

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting Gravatar...
I wonder from what planet ms digged up these coders & testers


Left by glgdf on Mar 09, 2007 2:10 AM

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting 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.
Left by Brendan on Jun 22, 2008 7:58 PM

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting 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.
Left by ADCoder on Dec 17, 2008 10:23 AM

# re: COMException (0x80004005): Unspecified error] in DirectorySearcher.FindAll() means LDAP string is invalid.
Requesting 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
Left by web development company on Aug 14, 2009 11:31 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net