Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with LDAP search: "Unknown error (0x80005000)"

1,465 views
Skip to first unread message

Steven

unread,
Sep 30, 2009, 11:40:34 AM9/30/09
to

I'm performing a rather simple search of an LDAP server (not an AD
domain controller) and I'm getting this error if I set my BaseDN for the
top of the tree:

######
param($entry)
$server = "<serverName>"
$path = "o=<orgName>"

$DN = "LDAP://$server/$path"
$auth = [System.DirectoryServices.AuthenticationTypes]::Anonymous
$de = New-Object
System.DirectoryServices.DirectoryEntry($DN,$null,$null,$auth)
$filter = "(mail=$($entry))"
$ds = New-Object
system.DirectoryServices.DirectorySearcher($de,$filter,$null)
$query = $ds.FindAll()
######

If I run this I get:
Exception calling "FindAll" with "0" argument(s): "Unknown error
(0x80005000)"
At E:\scripts\test.ps1:17 char:21
+ $query = $ds.FindAll( <<<< )

If I change the baseDN to be "ou=people,o=<orgName>" it works fine if
I'm searching for an object that is in that OU, however many of my
queries could be for objects outside of that container. If I perform an
LDAP query using ldp using the baseDN I originally started with (at the
top) it works fine. I looked at the search scope and it defaults to
subTree, which I'd think would allow this to work. Anyone know what I
might be missing?

0 new messages