How do you reset the SA password?

后端 未结 4 1018
醉酒成梦
醉酒成梦 2021-01-12 09:40

How on earth do you reset the sa password? I know how to go into the dialogs and reset a password. That\'s now what I\'m asking about. It runs a little deeper than just clic

4条回答
  •  轮回少年
    2021-01-12 10:00

    You could use: Reset-DbaAdmin Powershell cmdlet from https://dbatools.io.

    This function allows administrators to regain access to local or remote SQL Servers by either resetting the sa password, adding sysadmin role to existing login, or adding a new login (SQL or Windows) and granting it sysadmin privileges.

    This is accomplished by stopping the SQL services or SQL Clustered Resource Group, then restarting SQL via the command-line using the /mReset-DbaAdmin paramter which starts the server in Single-User mode, and only allows this script to connect.

    Using Reset-DbaAdmin will restart your SQL Server.

    Reset-DbaAdmin -SqlServer sqlcluster
    

提交回复
热议问题