Skip to content

Instantly share code, notes, and snippets.

@rogeriopradoj
Created November 18, 2019 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogeriopradoj/4b30a3707fe24be5845aa4f5712ac23e to your computer and use it in GitHub Desktop.
Save rogeriopradoj/4b30a3707fe24be5845aa4f5712ac23e to your computer and use it in GitHub Desktop.
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