Solved

linked servers and account

Posted on 2014-04-14
6
281 Views
Last Modified: 2014-04-16
I am trying to do some risk assessment work to determine any risks posed by current linked servers. I have the output of sys.linked_logins, sys.servers  and sys.server_principals which seem to be the main tables containig information about the links. But can anyone give any pointers on determining under which account our instance is connecting to the remote instance, and vice versa. Somewhere there must be clues as to which account is used in the link?
0
Comment
Question by:pma111
  • 3
  • 2
6 Comments
 
LVL 5

Assisted Solution

by:jayakrishnabh
jayakrishnabh earned 250 total points
ID: 39998856
Accounts used for the linked server can be found from the linkedserver properties window or create script of that
0
 
LVL 12

Accepted Solution

by:
Harish Varghese earned 250 total points
ID: 39998861
There is a script available at below link that lists all linked servers on current server and the logins associated with them. Please check:
http://gallery.technet.microsoft.com/scriptcenter/Get-List-of-Linked-Server-d6c95d9c

-Harish
0
 
LVL 3

Author Comment

by:pma111
ID: 39998890
Cant I use the information in the tables I already have as mentioned above?

Just seen the SQL so looks like I can use the data I already have as its using those tables in the script you linked to.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 3

Author Comment

by:pma111
ID: 39998900
so remote_name indicates the account in which you are connecting to the remote instance?
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 39998918
Right. And Local Login "Uses Self Credentials" indicates that the same credentials as the logged in user will be used to connect to the remote server.
0
 
LVL 12

Expert Comment

by:Harish Varghese
ID: 40003637
Here is the SQL (for future reference):
SELECT ss.server_id 
          ,ss.name 
          ,'Server ' = Case ss.Server_id 
                            when 0 then 'Current Server' 
                            else 'Remote Server' 
                            end 
          ,ss.product 
          ,ss.provider 
          ,ss.catalog 
          ,'Local Login ' = case sl.uses_self_credential 
                            when 1 then 'Uses Self Credentials' 
                            else ssp.name 
                            end 
           ,'Remote Login Name' = sl.remote_name 
           ,'RPC Out Enabled'    = case ss.is_rpc_out_enabled 
                                   when 1 then 'True' 
                                   else 'False' 
                                   end 
           ,'Data Access Enabled' = case ss.is_data_access_enabled 
                                    when 1 then 'True' 
                                    else 'False' 
                                    end 
           ,ss.modify_date 
      FROM sys.Servers ss 
 LEFT JOIN sys.linked_logins sl 
        ON ss.server_id = sl.server_id 
 LEFT JOIN sys.server_principals ssp 
        ON ssp.principal_id = sl.local_principal_id

Open in new window

0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now