Sorry for the delay, I'm was trying to remember how it all worked :)

First thing is first, you must add a linked server for ADSI. In Enterprise
Manager, goto Security, then Right Click on Linked Servers and add a new
one.

Provider Name: OLE DB Provider for Microsoft Directory Serivces
Product Name: Active Directory Services 2.5
Data Source: adsdatasource

Click on the security tab an click the bottom radio button: "Be made using
this security context" and assign an Active Directory user that can read all
of the AD, or at least the parts you want to query. You can work this stuff
a little to suit your needs:

Confirm all of that stuff.

Then you query would look something like this:
SELECT  [Name], sn AS [Last Name]
FROM OPENQUERY( ADSI, 
     'SELECT name, sn, street, l, st
      FROM ''GC:// DC=ad,DC=uky,DC=edu''
      WHERE objectCategory=''Person'' AND 
      objectClass = ''contact''')

Notice where it says ADSI, that is the name of the datasource you created
above.

One thing I found is that simply doing this still returns only 1000 records
because it is still using the LDAP stuff. We re-mapped that somehow, but I
cannot remember how we did that. I'm going through the code trying to
remember. I'll pass that along once I figure it out.

> -----Original Message-----
> From: Dawson, Michael [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 20, 2006 5:35 PM
> To: CF-Community
> Subject: RE: LDAP: Group List
> 
> Nick, can you give an example of a SQL view based on ADSI?
> 
> How do you make the views?  SQL Server 2000/2005?
> 
> I current have a DTS package that pulls data from AD.  I'm not sure if I
> used LDAP or ADSI.  I'll have to refresh my memory.
> 
> I'd like to take a look at any examples you can provide.  We are moving
> to a different student information system *and* SQL 2005 at the same
> time.  This would be a good opportunity to try something different and
> maybe better.
> 
> Thanks!



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:5:197732
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to