[pm-h] Can't determine what the problem is

Creason, Kevin (JSC-OH230)[ARES] kevin.creason-1 at nasa.gov
Wed Jan 13 09:39:42 PST 2010


Is this problem with me/my code? Or am I having a problem with the Net::LDAP
module?

I appreciate any insights-- I'm querying an active directory group which has
more than 1500 members which is apparently the cut-off. When you get 1501 or
more members the member list is split into ranges, so the attributes become
"member;range=0-1499", and also "member;range=1500-*" up to 2,999 in which
case it would advance to "member;range=1500-2999" and "member;range=3000-*".

Make sense? Final range is always an asterisk.

So here's the output-- I only see one range. The asterisk range is missing.
I have verified it really exists using command tools. So it is either
something in my syntax (which I don't think is true because I have dumbed
this way down) or in the module:

# ~kcreason/perl/biggroupdump
Att: "cn".
Att: "dSCorePropagationData".
Att: "description".
Att: "distinguishedName".
Att: "groupType".
Att: "instanceType".
Att: "member".
Att: "member;range=0-1499".
Att: "name".
Att: "objectCategory".
Att: "objectClass".
Att: "objectGUID".
Att: "objectSid".
Att: "sAMAccountName".
Att: "sAMAccountType".
Att: "uSNChanged".
Att: "uSNCreated".
Att: "whenChanged".
Att: "whenCreated".


Here's my code...

use Net::LDAP;
my $ad_ldap = Net::LDAP->new('servername');
my $error = $ad_ldap->bind('userprincipalname', password => 'password');
my $group_search = undef;
my @members;

$group_search = $ad_ldap->search(
'base' => 'the ldap base, is here',
'filter' => "(&(objectClass=group)(samaccountname=GroupName))",
'attrs' => [ '*',alloptions=>1 ]
);
die if ($group_search->code);

my @entries = $group_search->entries;
foreach my $entr (@entries)
 {
  foreach my $attr ( sort $entr->attributes) { print "Att: \"$attr\".\n"; }
 }

$ad_ldap->unbind;





More information about the Houston mailing list