Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failing to setup a linked server towards active directory

Status
Not open for further replies.

Robbomobb

Technical User
May 27, 2003
21
SE
Hi

My goal is to setup a linked server towards our domain controller (w2k) in order to retrieve information from user accounts.
I've executed the following code to setup the linked server.

sp_addlinkedserver 'ADSI', 'Active Directory Service Interfaces', 'ADSDSOObject', 'adsdatasource'

This code adds the liked server and it appears under the security/linked servers tab in the enterprise manager.

When i click on the "tables" i get the following error message:
"error 7301: Could not obtain a recuired interface from OLE DB provider 'ADSDSOObject'."

And when i try to execute the following query i get an error message saying:
"An error occurred while preparing a query for execution against OLE DB provider 'ADSDSOObject'."

The query used is:
SELECT * FROM OPENQUERY( ADSI, 'SELECT name ''LDAP://mydc/ OU=users,DC=mydomain,DC=local''')

Does anyone have an idea of what might be the problem?

Thankful for all replies.
 
I actually got this to work, hours after i posted this question.

The problem wasn't the code itself, it was the LDAP string that didn't match the directory structure. After I corrected the LDAP string I was able to query the AD for information. I still got an error when I clicked on "tables" in enterprise manager thou, so i had to use Query analyzer to fetch the required information.

Try changing the LDAP string so that it corresponds to the directory.

Hope this helps.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top