Solved

Can't open linked server to Active Directory

Posted on 2012-03-19
3
630 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
replicated - directional or bidirectional? 3 36
Webservices in T-SQL 3 34
How to search for strings inside db views 4 36
sql 2016 data tools breakdown.. 1 15
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

828 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