January 19, 2009 at 7:39 pm
Hi,
Is it possible to sync the details of active directory to sql server user table.
for example i wish to get the user details from active directory and store them in a user table which would be used by my application for user verification.
Can any one advise me on this 🙂
Thanks,
Sree
January 19, 2009 at 11:36 pm
Here is a blog post on one way to do it: http://blogs.msdn.com/ikovalenko/archive/2007/03/22/how-to-avoid-1000-rows-limitation-when-querying-active-directory-ad-from-sql-2005-with-using-custom-code.aspx
I'm not saying that this is how you should do it, I'm just saying you could do it this way. If the domain is small you could use the linked server approach as mentioned in the blog.
You could also use SSIS and the OLEDB Provider for Directory Services or a script task. Or you could just do something custom in .NET.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 6, 2009 at 8:26 am
Hi Sree
Try this code
selectconvert(varchar(50), [Name]) as FullName,
convert(varchar(50), Title) as Title,
convert(varchar(50), TelephoneNumber) as PhoneNumber,
convert(varchar(50), mail) as Email,
convert(varchar(50), department) as Department
INTO [Table Name]
fromopenquery(ADSI,'selectName, Title, TelephoneNumber, mail, department
FROM ''LDAP://OU=Users,OU=,DC=,DC=,DC=,DC=''
WHERE objectCategory = ''Person''
AND objectClass = ''user''
order by mail ')
Thanks
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply