Solved

Can't open linked server to Active Directory

Posted on 2012-03-19
3
633 Views
Last Modified: 2012-03-19
I created a linked server to Active Directory in SQL Server 2008.  I am getting the attached error.  Scripted linked server:

EXEC master.dbo.sp_addlinkedserver @server = N'ADSI', @srvproduct=N'Active Directory Service Interfaces', @provider=N'ADSDSOObject', @datasrc=N'adsdatasource'

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'ADSI',@useself=N'False',@locallogin=NULL,@rmtuser=N'my_username',@rmtpassword='########'

Ideas?
Error.docx
0
Comment
Question by:Eric3141
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 2

Author Comment

by:Eric3141
ID: 37738051
I setup security to run under my userid whichy has network admin privileges.
0
 
LVL 2

Accepted Solution

by:
Eric3141 earned 0 total points
ID: 37739234
Figured it out.  Query needs to be as below:


SELECT *
FROM OpenQuery(ADSI, 'SELECT title, displayName, sAMAccountName, givenName, telephoneNumber, facsimileTelephoneNumber, sn FROM ''LDAP://DC=sub-domain,DC=company,DC=com'' WHERE objectCategory=''user'' ')
0
 
LVL 2

Author Comment

by:Eric3141
ID: 37739249
If I work at MyStuff.com then the query would be:

SELECT * FROM OpenQuery(... FROM ''LDAP://DC=MyStuff,DC=COM''...

There is a "DC" to separate each part of the domain name.

If my domain = SomeAgency.ky.gov then the query would be:

SELECT * FROM OpenQuery(... FROM "LDAP://DC=SomeAgency,DC=KY,DC=gov''...
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question