How to automatically change linked server password

ora 21 Reputation points
2024-06-18T10:07:07.8066667+00:00

How to automatically change linked server password

SQL Server | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,346 Reputation points
    2024-06-18T15:19:30.25+00:00

    This blog article talks about the T-SQL you need to run from PS to change a linked server password. Just call it from PS.

    Note that changing a linked server's password will break existing linked server connections. So either do this outside the hours you're using the linked server or ensure the server's password is changed in both places really close together and not when the connection may be in use.

    0 comments No comments

  2. Olaf Helper 47,516 Reputation points
    2024-06-19T06:01:28.5866667+00:00

    You didn't explain the logic for "new password for which login"?

    If you want to use PowerShell, use the PowerShell CmdLet "DbaTools"

    https://docs.dbatools.io/Get-DbaLinkedServer.html

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.