In message <OADYDah8DHA.2316 (AT) TK2MSFTNGP09 (DOT) phx.gbl>, Fredrik Green
<fredrik_gr (AT) hotmail (DOT) com> writes
Quote:
I would like to schedule a user synchronization from Active Directory to
another DB using DTS. Has anyone ideas on how to get started with this?
Is there a way to make a DB connection object via ADSI to query it using
LDAP?
If I just can get that part to work, the rest is easy.
/ Fredrik Green |
I fudge it through a SQL Sever connection, and a linked server which
uses the OLE-DB Provider for Microsoft directory Services, and then use
OPENQUERY in TSQL-
SELECT samaccountname, department, company, telephonenumber, mail, sn,
givenname, l
FROM OpenQuery(ADSI, 'SELECT l, ou, name, givenname, sn, manager, mail,
telephonenumber, company, department, mobile, samaccountname
FROM ''LDAP://dc=darren,dc=Com'' WHERE objectCategory=''person'' AND
objectClass=''user'' ')
WHERE sn is not null and givenname is not null
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com
PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org