Hi there
This is the kind of queries I used and it actually loads the data more than 1000 records. You just need to amend it slightly for the company involved. You can use this in a stored procedure and the store procedure to run as a sql job.
SELECT TOP 100 PERCENT Rowset_1.*, sn + ', ' + givenName AS FULL_NAME
FROM OPENQUERY(ADSI,
'SELECT title, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn, mail, userAccountControl FROM ''LDAP://DC=our,DC=domain,DC=org'' WHERE objectCategory = ''Person'' AND objectClass=''user'' and userAccountControl>1000')
Rowset_1
WHERE sn IS NOT NULL
UNION
SELECT TOP 100 PERCENT Rowset_1.*, sn + ', ' + givenName AS FULL_NAME
FROM OPENQUERY(ADSI,
'SELECT title, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn, mail, userAccountControl FROM ''LDAP://DC=our,DC=domain,DC=org'' WHERE objectCategory = ''Person'' AND objectClass=''user'' and userAccountControl<1000')
Rowset_1
Atia