April 28, 2006 at 3:58 pm
Hello all,
I want to use SQL server to connect to LDAP and return email address, first name, last name and all other details. Can anyone knows how to do this?
Any help would be greatly appreciated.
Thanks,
Ramesh.
April 30, 2006 at 11:47 am
Give this a try - this worked for me on SQL 2005 instance. I'm assuming you're going to Active directory, but not sure...You also must have read permissions on Active Directory.
EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', 'ADSDSOObject', 'adsdatasource'
GO
EXEC sp_addlinkedsrvlogin 'ADSI', 'true', 'Domain\userid', NULL, NULL
GO
Select *
FROM OPENQUERY(ADSI, 'Select sn, givenName, mail
FROM ''LDAP://SERVERNAME/ DC=domainpart1,DC=domainpart2,DC=local'' WHERE objectClass= ''user'' ORDER BY cn ')
May 1, 2006 at 7:12 am
how to get parameters for
''LDAP://SERVERNAME/ DC=domainpart1,DC=domainpart2,DC=local'' WHERE objectClass= ''user''
i m having problem here now.
Thanks,
Ramesh.
May 9, 2006 at 7:10 am
what about other parameters?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply