-
Get/Set Linked Server login info?
How can I obtain and set the security context for a linked server connection?
Most of the connection details are available from the sys.servers table, but
not this.
I am referring specifically to the Remote login and With password entries on
the Security page of the Linked Server properties page below the "For a login
not defined in the list above, connections will:"
My goal is to create a script to automate the process of obtaining/updating
these values when we update logins and/or passwords used for these
connections.
TIA
-
Re: Get/Set Linked Server login info?
dj,
The information available to you (assuming SQL Server 2005) is in
sys.linked_logins. However, since some of the cases require supplying a
password, which is kept elsewhere, both you and SSMS are resticted to
scripting a password like '########'.
In case this was not already clear to you, if you script out a linked
server, for the default connection you will get an entry where
@locallogin=NULL, represented in sys.linked_logins as local_principal_id =
0. So from the 0 principal rows in sys.linked_logins:
1. Not be made -- No NULL login entry in sys.linked_logins for that server
2. Be made without using a security context -- uses_self_credential = 0
3. Be made using the login's current security context --
uses_self_credential = 1
4. Be made using this security context -- uses_self_credential = 0,
remote_name = 'remotelogin'
RLF
"dj" wrote in message
news:ED5A32D7-8DE6-474E-A725-C124E6B5D78F@microsoft.com...
> How can I obtain and set the security context for a linked server
> connection?
>
> Most of the connection details are available from the sys.servers table,
> but
> not this.
> I am referring specifically to the Remote login and With password entries
> on
> the Security page of the Linked Server properties page below the "For a
> login
> not defined in the list above, connections will:"
>
> My goal is to create a script to automate the process of
> obtaining/updating
> these values when we update logins and/or passwords used for these
> connections.
>
> TIA