Skip to content

Instantly share code, notes, and snippets.

@rogeriopradoj

rogeriopradoj/1.sql

Created Nov 18, 2019
Embed
What would you like to do?
https://gallery.technet.microsoft.com/scriptcenter/Get-List-of-Linked-Server-d6c95d9c - This script will get the list of Linked server with its properties and its associated local/Remote login list. The properites listed are Server,Product , Provider , Catalog , RPC out Enabled and Data Access Enabled. Also this lists the local login and remote…
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.