Monday, March 26, 2012

How can I query a trusted domain (from MS SQL)?

I've defined a linked ADSI server and I seem to be able to query the
local domain ( localdomain.com ) with:

DBCC TRACEON(7300)
GO
SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
''LDAP://DC=localdomain,DC=com'' ')

But I also have a trusted domain ( trusteddomain.com ) which I would
also like to query from the same SQL-enviroment but this does not work
:( :

DBCC TRACEON(7300)
GO
SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
''LDAP://DC=trusteddomain,DC=com'' ')

Error returned:
"OLE DB error trace [Non-interface error: OLE DB provider
ADSDSOObject returned DBPROP_STRUCTUREDSTORAGE without
DBPROPVAL_OO_BLOB being supported].
OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
IRowset::GetNextRows returned 0x8007202b]."

What am I doing wrong? From within windows-explorer I have no problem
obtaining the userlist from trusted domain when I want to assign
file-permissions.
Any idea?Write a VB script with the following:

Set objRoot = GetObject(LDAP://dc=trusteddomain,DC=com)
WScript.Echo objRoot.Name

and run it on the SQL server. IF this does not work, then a linked ADSI
server won't work either. I've never used trusted domains in W2K, but check
DNS settings. The client needs to find a domaincontroller for the given
domain. Also, you could try adding the domaincontroller of the trusted
domain to your query:

LDAP://nameofdcintrusteddomain/dc=trusteddomain,dc=com

Arild

"Ammar" <ammar_fake@.vip.hr> wrote in message
news:647d9cb9.0404211523.d8941c7@.posting.google.co m...
> I've defined a linked ADSI server and I seem to be able to query the
> local domain ( localdomain.com ) with:
> DBCC TRACEON(7300)
> GO
> SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
> ''LDAP://DC=localdomain,DC=com'' ')
> But I also have a trusted domain ( trusteddomain.com ) which I would
> also like to query from the same SQL-enviroment but this does not work
> :( :
> DBCC TRACEON(7300)
> GO
> SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
> ''LDAP://DC=trusteddomain,DC=com'' ')
> Error returned:
> "OLE DB error trace [Non-interface error: OLE DB provider
> ADSDSOObject returned DBPROP_STRUCTUREDSTORAGE without
> DBPROPVAL_OO_BLOB being supported].
> OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
> IRowset::GetNextRows returned 0x8007202b]."
> What am I doing wrong? From within windows-explorer I have no problem
> obtaining the userlist from trusted domain when I want to assign
> file-permissions.
> Any idea?|||If should of course be:

Set objRoot.GetObject("LDAP://dc=trusteddomain,DC=com")

(Outlook Express is a bit too _smart_ )

Arild

"Arild Bakken" <arildb_@.hotmail.com> wrote in message
news:O2N%23mZDKEHA.208@.tk2msftngp13.phx.gbl...
> Write a VB script with the following:
> Set objRoot = GetObject(LDAP://dc=trusteddomain,DC=com)
> WScript.Echo objRoot.Name
> and run it on the SQL server. IF this does not work, then a linked ADSI
> server won't work either. I've never used trusted domains in W2K, but
check
> DNS settings. The client needs to find a domaincontroller for the given
> domain. Also, you could try adding the domaincontroller of the trusted
> domain to your query:
> LDAP://nameofdcintrusteddomain/dc=trusteddomain,dc=com
>
> Arild
> "Ammar" <ammar_fake@.vip.hr> wrote in message
> news:647d9cb9.0404211523.d8941c7@.posting.google.co m...
> > I've defined a linked ADSI server and I seem to be able to query the
> > local domain ( localdomain.com ) with:
> > DBCC TRACEON(7300)
> > GO
> > SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
> > ''LDAP://DC=localdomain,DC=com'' ')
> > But I also have a trusted domain ( trusteddomain.com ) which I would
> > also like to query from the same SQL-enviroment but this does not work
> > :( :
> > DBCC TRACEON(7300)
> > GO
> > SELECT * FROM OPENQUERY(ADSI, 'SELECT displayName FROM
> > ''LDAP://DC=trusteddomain,DC=com'' ')
> > Error returned:
> > "OLE DB error trace [Non-interface error: OLE DB provider
> > ADSDSOObject returned DBPROP_STRUCTUREDSTORAGE without
> > DBPROPVAL_OO_BLOB being supported].
> > OLE DB error trace [OLE/DB Provider 'ADSDSOObject'
> > IRowset::GetNextRows returned 0x8007202b]."
> > What am I doing wrong? From within windows-explorer I have no problem
> > obtaining the userlist from trusted domain when I want to assign
> > file-permissions.
> > Any idea?

No comments:

Post a Comment