glewis1636
Programmer
I'm trying to get my users' e-mail addresses from active directory. after much distress and head pounding, I finally (at least apparently) have successfully created a linked server to my active directory. The problem is that I am getting no results from my query on users. Here is my code...
I'm 95% certain of the LDAP statement based on looking at the active directory. Any ideas on what else could cause me to get no results?
Thanks
Code:
CREATE VIEW viewADContacts
AS
SELECT [Name], sn [Last Name], street [Street], l [City], st [State], mail [E-mail]
FROM OPENQUERY( ADSI,
'SELECT name, sn, street, l, st, mail
FROM ''LDAP://stexxxx/DC=soidom001,DC=local''
WHERE objectcategory = ''person'' and
objectClass = ''user''')
GO
SELECT * FROM viewADContacts
I'm 95% certain of the LDAP statement based on looking at the active directory. Any ideas on what else could cause me to get no results?
Thanks