do you really need #1 all active directory uses, or #2 only the ones in a certain group?
there's an extended stored proc that makes #2 easy:
--you need to KNOW the name of the AD group
EXEC master..xp_logininfo @acctname = 'disney\authenticatedusers',@option = 'members' -- show group members
for all users, you'll run into problems using an LDAP linked server, as it will only return the first 1000 rows/records; i've done it in a programming language to get all of them, and i think there's a work around, but it's been a while since i had to research this.
--doesn't quite work...permissions
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'
select * from openquery
(ADSI,'SELECT cn, mail, co, distinguishedName, displayName
FROM ''LDAP://mydomain'' '
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!