mrdenny
Programmer
- May 27, 2002
- 11,595
I'm trying to pull a list of all accounts from Active directory into a SQL Table for processing.
I've got my query working fine.
It returns the records I'm looking for. But it hits the 1000 record mark (we have about 1700 employees).
Does anyone have a good method of getting more additional pages of records from the AD network.
I've found many ways to do this in ADO, but I don't want to use ADO, I want to do all my processing directly through T/SQL.
Does any one have any ideas?
Denny
MCSA (2003) / MCDBA (SQL 2000)
--Anything is possible. All it takes is a little research. (Me)
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
(Not quite so old any more.)
I've got my query working fine.
Code:
select *
from openquery
(
ADSI,'SELECT cn, mail, sAMAccountName, userAccountControl
FROM ''LDAP://domain.com''
WHERE objectCategory = ''Person''
AND objectClass = ''user''
order by mail
'
)
Does anyone have a good method of getting more additional pages of records from the AD network.
I've found many ways to do this in ADO, but I don't want to use ADO, I want to do all my processing directly through T/SQL.
Does any one have any ideas?
Denny
MCSA (2003) / MCDBA (SQL 2000)
--Anything is possible. All it takes is a little research. (Me)
![[noevil] [noevil] [noevil]](/data/assets/smilies/noevil.gif)
(Not quite so old any more.)