Re: Linked Server and ADSI
From: Mike Hodgson (mwh_junk_at_hotmail.com)
Date: 11/18/04
- Next message: Michael C: "Re: RADiest Client for SQL Server"
- Previous message: Dan Guzman: "Re: changing a query"
- In reply to: sfibich: "Linked Server and ADSI"
- Next in thread: sfibich: "Re: Linked Server and ADSI"
- Reply: sfibich: "Re: Linked Server and ADSI"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 18 Nov 2004 11:20:59 +1100
That's fine but you'll need some remote login credentials with which to
query AD (otherwise what security context is it going to use?). I've set up
links to AD from my SQL servers by adding the linked server (as you've done)
and then adding a remote login mapping so that all local logins use a
specific set of credentials to connect via ADSI (I'm not overly concerned
about oppressive security in this case because any user that connects to my
SQL box can also query AD anyway - this just makes multi-source queries a
little more transparent/seamless). Specifically I've set up the mapping so
that all local logins use the service account under which SQL is running
(ie. Windows account). That is,
exec sp_addlinkedsrvlogin 'ADSI', false, NULL,
'MyDomain\MySQLServiceAccount', 'MyServiceAccountPassword'
So any SQL client session that issues an ADSI query through that linked
server will query AD using the service account that SQL server is running
under (this assumes you're running your SQL server under a domain account,
not as System or a local SAM account). Works pretty well for me - the only
thing you have to bear in mind is you can only query the bits of AD that the
SQL service account has been granted permissions to query.
-- Cheers, Mike "sfibich" <sfibich@pfgc.com> wrote in message news:u2w7zDOzEHA.1264@TK2MSFTNGP12.phx.gbl... > Does anyone one know how to create a linked server to active directory on > a sql server that is not a domain controller? > > I have tried the following to add the linked server > EXEC sp_addlinkedserver 'ADSI', 'Active Directory Services 2.5', > 'ADSDSOObject', > 'adsdatasource' > > > but I can not issue any querys without getting the following error > Server: Msg 7321, Level 16, State 2, Line 1 > An error occurred while preparing a query for execution against OLE DB > provider 'ADSDSOObject'. > OLE DB error trace [OLE/DB Provider 'ADSDSOObject' > ICommandPrepare::Prepare returned 0x80040e14]. > > > This is running on a windows 2000 sql 2000 box. > > Thanks in advance.
- Next message: Michael C: "Re: RADiest Client for SQL Server"
- Previous message: Dan Guzman: "Re: changing a query"
- In reply to: sfibich: "Linked Server and ADSI"
- Next in thread: sfibich: "Re: Linked Server and ADSI"
- Reply: sfibich: "Re: Linked Server and ADSI"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|