Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Directory-How do I display more than 1000 records?

Status
Not open for further replies.

FancyPrairie

Programmer
Oct 16, 2001
2,917
US
I have created a linked server for Active Directory and have created the following query. But I only receive 1000 records. From what I understand, I should be able to set the Page Size property. But that doesn't seem to work. I have also tried setting the Size Limit property, but no luck there either.

What am I doing wrong?

Code:
SELECT     *
FROM         OPENROWSET('AdsDsoObject', 'User ID=;Password=;ADSI Flag=0x11;Size Limit=0;Page Size=20000', 
                      'SELECT
        sAMAccountName,
        givenname,
        middleName,
        sn,
        displayName
    FROM
        ''LDAP://OU=xxx,OU=xxx,DC=xx,DC=xxx,DC=xx''
    WHERE
        objectCategory = ''Person''
        AND objectClass = ''user''
    ')
                       Rowset_1
 
Instead of setting it to 20000, try set it to smaller within limit, 1000 (which is the adsi query limited page size) or slightly below. After all, it is the purpose of the setting to page through it, not forcing it to expand beyond the limit. But, I know not linked server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top