Rollin,
Here's the query that does what you are looking for (you will need to change the domain info). There's some free downloads on the internet that will let you browse the AD database but I don't have access to the one I normally use.
SELECT *
FROM OPENROWSET('ADsDSOObject','Active Directory Provider',
'SELECT displayName, sAMAccountName, mail
FROM ''LDAP://dc=buediamond,dc=com'' WHERE objectCategory = ''User''')
Kurt
>I need to do LDAP queries against Active Directory to pull user login names and email addresses. I have not done LDAP queries before. How would I do this??
>
>I have tried to find info on LDAP query format and syntax, but have not found a good source.
>
>All help is greatly appreciated.