SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Linked Server Error with Domain Admin
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bholmstrom
Yak Posting Veteran

USA
71 Posts

Posted - 04/03/2013 :  13:38:16  Show Profile  Reply with Quote
I am getting this error when querying the Active Directory

Msg 7321, Level 16, State 2, Line 27
An error occurred while preparing the query "SELECT DisplayName, title,mail
FROM 'LDAP://CBC-03/DC=jhcohn,DC=com'
WHERE objectClass = 'Person'
" for execution against OLE DB provider "ADsDSOObject" for linked server "ADSI".

I am not the DOmain Admin, but the lady that is gets the same error.

Here is the Code that linked the server:

EXEC master.dbo.sp_addlinkedserver @server = N'ADSI',
@srvproduct=N'Active Directory Services', @provider=N'ADsDSOObject',
@datasrc=N'cbc-03.jhcohn.com' --AKA the full computer name of the AD server

Here is the query code:

SELECT * FROM OpenQuery
(
ADSI,
'SELECT DisplayName, title,mail
FROM ''LDAP://CBC-03/DC=jhcohn,DC=com''
WHERE objectClass = ''Person''
')

Any ideas, thanks in advance

Bryan Holmstrom

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2047 Posts

Posted - 04/03/2013 :  14:59:29  Show Profile  Visit jackv's Homepage  Reply with Quote
what sql server version are you running?

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

russell
Pyro-ma-ni-yak

USA
5072 Posts

Posted - 04/03/2013 :  15:47:06  Show Profile  Visit russell's Homepage  Reply with Quote
Might want to look at this thread
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000