Hi Michele,

 

Thanks for the tips.

 

Here is what I get for an error:

 

"The size limit for this request was exceeded.

 

Win32::OLE(0.1709) error 0x80072023: "The size limit for this request was

exceeded"

    in METHOD/PROPERTYGET "MoveNext" at temp-perl-findallusers.pl line 62"

 

If I add this line:

 

$objConn->Properties('Page Size')->{Value} = 10;

 

"I get this for an error:

 

OLE exception from "ADODB.Connection":

 

Item cannot be found in the collection corresponding to the requested name

or ordinal.

 

Win32::OLE(0.1709) error 0x800a0cc1

    in METHOD/PROPERTYGET "Properties" at temp-perl-findallusers.pl line 58"

 

 

Thanks,
Rich

 

 

From: Michele Berg [mailto:[email protected]] 
Sent: Thursday, April 21, 2011 11:34 AM
To: Gomes, Rich
Subject: Re: AD Page Size help

 

Also, something you may want to consider - are you sure you're hitting a search 
limit?  Depending on the structure of your domain and how deeply-nested it is, 
you may need to chase referrals in order to search sub-domains:

 

$objConn->Properties('Chase Referrals')->{Value} = ADS_CHASE_REFERRALS_ALWAYS;

 

Michele

On Thu, Apr 21, 2011 at 10:31 AM, Michele Berg <[email protected]> wrote:

When I set my page size, I set it like so:

 

$objConn->Properties('Page Size')->{Value} = 10;

 

Notice that the number you use here doesn't seem to limit the number of records 
returned by the query - it just affects behind-the-scenes ADSI processing.  We 
originally tried 1000 but it occasionally hung; once we reduced it to 10 we had 
no more problems.  The large page size seemed to allow some timeouts to occur.

 

hth,

 

Michele

 

On Thu, Apr 21, 2011 at 10:18 AM, Gomes, Rich <[email protected]> 
wrote:

I know this has been talked about a lot but I cannot seem to get my script to 
work.
I am trying to not hit the LDAP search limit but cannot seem to get the 
PageSize line correct


Any thoughts?


_____________________________________________________________________________

my $strDomainDN = "DC=mydomain,DC=com";
use Win32::OLE qw(in);


$Win32::OLE::Warn = 3;
my $strBase   =  "<LDAP://" . $strDomainDN . ">;";


my $strFilter = "(&(objectclass=user)(objectcategory=person));";
my $strAttrs  = "name;";
my $strAttrs  = "distinguishedName;";
my $strScope  = "subtree";

my $objConn = Win32::OLE->CreateObject("ADODB.Connection");
$objConn->{Provider} = "ADsDSOObject";
$objConn->Open;

$objConn->{Properties}->{"Page Size"} = 100;

my $objRS = $objConn->Execute($strBase . $strFilter . $strAttrs . $strScope);
$objRS->MoveFirst;
while (not $objRS->EOF) {
   print $objRS->Fields(0)->Value,"\n";
   $objRS->MoveNext;
}

_______________________________________________________________________________



_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

 

 

_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to