Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

linked server error

Posted on 2007-10-12
7
Medium Priority
?
914 Views
Last Modified: 2007-10-14
Using openquery through my application I got this error:

       <[Microsoft][ODBC SQL Server Driver][SQL Server]The OLE DB provider "ADSDSOObject"
      for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the
      operation.>.>.

Iam running a select query using openquery.

any help is greatly appreciated.

Thanks
0
Comment
Question by:raGadiraju
  • 3
  • 3
7 Comments
 
LVL 27

Expert Comment

by:ptjcb
ID: 20067484
Are both database using Windows or SQL authentication? Are the servers on the same domain?
0
 
LVL 16

Expert Comment

by:SQL_SERVER_DBA
ID: 20067545
If you logged in with SQL Server authentication then make sure you have privilages to the linked database.
0
 

Author Comment

by:raGadiraju
ID: 20067584
I have both windows and sql auth.

How do I make sure I have all the privileges. What specific privileges should I check for and where? I am kind of new to sql server.

Tahnks
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 27

Expert Comment

by:ptjcb
ID: 20067659
ADSI is the Active Directory. Do you have the necessary rights?

You have to add the linked server login.


usage of sp_addlinkedsrvlogin:

sp_addlinkedsrvlogin [ @rmtsrvname = ] 'rmtsrvname'
[ , [ @useself = ] 'useself' ]
[ , [ @locallogin = ] 'locallogin' ]
[ , [ @rmtuser = ] 'rmtuser' ]
[ , [ @rmtpassword = ] 'rmtpassword' ]

For example,

EXEC sp_addlinkedsrvlogin 'ADSI', false, 'sa', 'Administrator', 'password'
0
 

Author Comment

by:raGadiraju
ID: 20067773
hI PTJCB:

Ia m trying to run that proc. I will keep u posted.

Thanks
Raj
0
 

Author Comment

by:raGadiraju
ID: 20067808
I ran the stored proc and here's what I see:

Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "ADSDSOObject" for linked server "ADSI" reported an error. The provider indicates that the user did not have the permission to perform the operation.
Msg 7321, Level 16, State 2, Line 2
An error occurred while preparing the query "SELECT givenname,sn,objectGUID,userPrincipalName,samAccountName,displayname

     FROM 'LDAP://usnjpar1wdc01.us.ad.irmc.com'

     WHERE objectCategory = 'Person' AND objectClass= 'user'

       AND samAccountName='PPandit'" for execution against OLE DB provider "ADSDSOObject" for linked server "ADSI".
0
 
LVL 27

Accepted Solution

by:
ptjcb earned 2000 total points
ID: 20067818
OK. You may not have the rights to run access the Active Directory.

Right-click My Computer, Manage, Service. Find the SQL Server service. Double-click and you should see the Log on tab.

What does it say. If you are logged on as a Local System, you do not have network privileges. You need to log on to SQL Server with an account that has domain privileges and permissions in the AD (I have no idea which account that would be, it's your network).

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

572 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