all groups > sql server dts > february 2004 >
You're in the

sql server dts

group:

Doing LDAP queries in DTS


Doing LDAP queries in DTS Fredrik Green
2/13/2004 10:48:20 AM
sql server dts:
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

Re: Doing LDAP queries in DTS Darren Green
2/13/2004 7:36:11 PM
In message <OADYDah8DHA.2316@TK2MSFTNGP09.phx.gbl>, Fredrik Green
<fredrik_gr@hotmail.com> writes
[quoted text, click to view]

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
AddThis Social Bookmark Button