LDAP group membership query

P

Paul

I am trying to query an NDS tree using the Win32::OLE and
Win32::OLE::Enum modules. I was able to traverse the tree and gather
all the group names, however, I can't seem to get the members of the
groups. I've tried several methods and I must be missing something.
Below is a snippet of the last try. Any help would be greatly
appreciated.

my $obj = Win32::OLE->GetObject("LDAP://$srv/$oh")||die
Win32::OLE->LastError();
foreach my $object (in $obj)
{
my $objectclass = $object->Get(objectClass);
foreach my $objclass (in $objectclass)
{
if ($objclass eq "organizationalUnit")
{
&showgrp("$object->{Name},$oh");
}
if ($objclass eq "groupOfNames")
{
print "$object->{Name}\t$object->{Class}\t$object->{ADsPath}\n";
my $grpenum = Win32::OLE::Enum->new($object)|| die
Win32::OLE->LastError();
foreach ($grpenum->All)
{
if(lc($_->{'class'}) eq "member")
{
print "$_->{Name}\n";
}
}
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top