Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Can't open linked server to Active Directory

Posted on 2012-03-19
3
Medium Priority
?
636 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
  • 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

971 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