Windows Perl Scripting Forums » Scripts

Please help: "the size limit for this request was exceeded"

(1 post)
  • Started 6 years ago by StarkRavingCalm

No tags yet.


  1. StarkRavingCalm
    Member

    I am running a script to get all users in our domain but keep hitting the search limit.
    Here is the error:
    Win32::OLE(0.1709) error 0x80072023: "The size limit for this request was exceeded"
    in METHOD/PROPERTYGET "MoveNext"

    I have read a can add a line similar to:
    #$objADOcmd->Properties->{"Page Size"} = 1000;

    But have had no luck so far.

    Any help is appreciated

    Thanks!

    Here's the code:

    ## Taken from the following URL:
    # http://techtasks.com/code/viewbookcode/1580
    
    # This Perl code finds all user accounts in a domain.
    
    # ---------------------------------------------------------------
    # Provided as a web-only addition for the book:
    #     "Active Directory Cookbook" by Robbie Allen
    # ISBN: 0-596-00466-4
    # ---------------------------------------------------------------
    
    # ------ SCRIPT CONFIGURATION ------
    my $strDomainDN = "DC=mydomain,DC=com"; 
    
    # ------ END CONFIGURATION ---------
    use Win32::OLE;
    $Win32::OLE::Warn = 3;
    my $strBase   =  "<LDAP://" . $strDomainDN . ">;";
    # To search the whole forest using the global catalog, uncomment the following line:
    # $strBase   =  "<GC://" . $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;
    my $objRS = $objConn->Execute($strBase . $strFilter . $strAttrs . $strScope);
    $objRS->MoveFirst;
    while (not $objRS->EOF) {
        print $objRS->Fields(0)->Value,"\n";
        $objRS->MoveNext;
    }
    Posted 6 years ago #

RSS feed for this topic

Reply

You must log in to post.