Thursday, March 8, 2012

ADSI hetrogenous queries

Hi guys
I think I'm going insane, as I'm having a problem with something I've never
had issues with before: I'm moving a database to a new server, but the
destination server also requires the ADSI distributed server to be configure
d.
So far as I remember it, this is what I thought I needed to do:
1. Create the linked server definition and password:
EXEC sp_addlinkedserver 'ADSI', 'Directory Services', 'ADSDSOOBJECT',
'dsadatasource'
go
EXEC sp_addlinkedsrvlogin ADSI, 'false', NULL, 'domain\account', 'password'
go
2. Execute a query such as:
SELECT *
FROM OPENQUERY(ADSI,
'<LDAP://DC=SOME,DC=DOMAIN,DC=COM>;(&(objectClass=user)(sAMAccountName=jblog
gs));ADsPath;subTree')
When I run this on my original sever (I even ran the link creation steps
creating an ADSI2 connection for test purposes) the query returns the
expected row. When I run it on the new machine, I get the following error:
Server: Msg 7320, Level 16, State 2, Line 1
Could not execute query against OLE DB provider 'ADSDSOOBJECT'.
OLE DB error trace [OLE/DB Provider 'ADSDSOOBJECT' ICommandText::Execute
returned 0x80040e22].
The above two steps are how I successfully configured the original server.
I thought this may have been some form of COM issue, but when I compared the
configuration of both machine (assuming I haven't missed anything obvious)
they looked the same.
The domain account I'm using for the directory authentication is the same
one as the MSSSQLSERVICE service runs under, which in addition is a local
administrator.
I'm not really expecting an answer on this as it seems terribly cryptic, but
if you have any suggestions they'd be most welcome
Cheers
Lain> Hi guys
> I think I'm going insane, as I'm having a problem with something I've
never
> had issues with before: I'm moving a database to a new server, but the
> destination server also requires the ADSI distributed server to be
configured.
> So far as I remember it, this is what I thought I needed to do:
> 1. Create the linked server definition and password:
> EXEC sp_addlinkedserver 'ADSI', 'Directory Services', 'ADSDSOOBJECT',
> 'dsadatasource'
> go
> EXEC sp_addlinkedsrvlogin ADSI, 'false', NULL, 'domain\account',
'password'
> go
> 2. Execute a query such as:
> SELECT *
> FROM OPENQUERY(ADSI,
>
'<LDAP://DC=SOME,DC=DOMAIN,DC=COM>;(&(objectClass=user)(sAMAccountName=jblog
gs));ADsPath;subTree')
> When I run this on my original sever (I even ran the link creation steps
> creating an ADSI2 connection for test purposes) the query returns the
> expected row. When I run it on the new machine, I get the following error:
> Server: Msg 7320, Level 16, State 2, Line 1
> Could not execute query against OLE DB provider 'ADSDSOOBJECT'.
> OLE DB error trace [OLE/DB Provider 'ADSDSOOBJECT' ICommandText::Execu
te
> returned 0x80040e22].
> The above two steps are how I successfully configured the original server.
> I thought this may have been some form of COM issue, but when I compared
the
> configuration of both machine (assuming I haven't missed anything
obvious)
> they looked the same.
> The domain account I'm using for the directory authentication is the same
> one as the MSSSQLSERVICE service runs under, which in addition is a local
> administrator.
> I'm not really expecting an answer on this as it seems terribly cryptic,
but
> if you have any suggestions they'd be most welcome
> Cheers
> Lain
--
Check your OLE DB provider options and make sure "AllowInProcess" is turned
on:
HKLM Software\Microsoft\MSSQLServer\Providers
\ADSDSOObject -
AllowInProcess = 1
Hope this helps,
Eric Crdenas
Senior support professional
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thank you Eric. Perfecto!

No comments:

Post a Comment