hrm... I know that when I use net::ldap, I have to have paging to get
anything over 1000 returns.


<from perldoc on net::ldap::control::paged>

NAME
    Net::LDAP::Control::Paged - LDAPv3 Paged results control object

SYNOPSIS
     use Net::LDAP;
     use Net::LDAP::Control::Paged;
     use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );

     $ldap = Net::LDAP->new( "ldap.mydomain.eg" );

     $page = Net::LDAP::Control::Paged->new( size => 100 );

     @args = ( base     =>
"cn=subnets,cn=sites,cn=configuration,$BASE_DN",
               scope    => "subtree",
               filter   => "(objectClass=subnet)",
               callback => \&process_entry, # Call this sub for each
entry
               control  => [ $page ],
     );

     my $cookie;
     while(1) {
       # Perform search
       my $mesg = $ldap->search( @args );

       # Only continue on LDAP_SUCCESS
       $mesg->code and last;

       # Get cookie from paged control
       my($resp)  = $mesg->control( LDAP_CONTROL_PAGED ) or last;
       $cookie    = $resp->cookie or last;

       # Set cookie in paged control
       $page->cookie($cookie);
     }

     if ($cookie) {
       # We had an abnormal exit, so let the server know we do not want
any more
       $page->cookie($cookie);
       $page->size(0);
       $ldap->search( @args );
     }

DESCRIPTION
    "Net::LDAP::Control::Paged" provides an interface for the creation
and
    manipulatrion of objects that represent the "pagedResultsControl" as
    described by RFC-2696.

CONSTRUCTOR ARGUMENTS
    In addition to the constructor arguments described in the
    Net::LDAP::Control manpage the following are provided.

    cookie
        The value to use as the cookie. This is not normally set when an
        object is created, but is set from the cookie value returned bu
the
        server. This associates a search with a previous search, so the
        server knows to return the page of entries following the entries
it
        returned the previous time.

    size
        The page size that is required. This is the maximum number of
        entries that the server will return to the search request.

METHODS
    As with the Net::LDAP::Control manpage each constructor argument
    described above is also avaliable as a method on the object which
will
    return the current value for the attribute if called without an
    argument, and set a new value for the attribute if called with an
    argument.

SEE ALSO
    the Net::LDAP manpage, the Net::LDAP::Control manpage,
    http://info.internet.isi.edu/in-notes/rfc/files/rfc2696.txt

AUTHOR
    Graham Barr <[EMAIL PROTECTED]>

    Please report any bugs, or post any suggestions, to the perl-ldap
    mailing list <[EMAIL PROTECTED]>

-----Original Message-----
From: Roger [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 05, 2002 11:48 AM
To: [EMAIL PROTECTED]
Subject: LDAP/ADSI Question


I think it's an LDAP question.
With the following snippet of code:
#####################
$c=Win32::OLE->new("ADODB.Connection");
$c->{Provider}="ADsDSOOBject";
$c->Open("ADSI Provider");
die Win32::OLE->LastError() if
Win32::OLE->LastError();
$adspath="LDAP://SERVER/ou=AnyOU,dc=SOME,dc=ORG";;
$rs=$c->Execute("<$adspath>;(objectClass=user);ADsPath;
Subtree");
until ($rs->EOF){
   $u= $rs->Fields(0)->{Value};
   print "$u\n";
$rs->moveNext;
}
########
This should in theory display every item in the OU.
The problem is that it displays only the first 1000
items.
Supposedly the default is to be unlimited in size, but
1000 seems to be the actual limit.  There is supposed
to be a way to set the 'size limit' but I've been
unable to figure out how.  
Does anybody know how to set the size limit for the
query?

Roger


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
_______________________________________________
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