Archive

Archive for June, 2018

Reset SQL Server SA Login via Powershell

June 13th, 2018 No comments

The Problem

You have lost or forgotten the SA password for you SQL Server box!!

The solution

This is really easy to fix.
On the server do the following:

  1. Launch Powershell as an administrator
  2. Run:
    Install-Module dbatools
  3. Answer “Y” when prompted (twice for me).
  4. Run
    Reset-DbaAdmin -SqlServer localhost\SQLEXPRESSS

    (or whatever your database is, a “.” will suffice for a standard default sql installation”)
  5. Answer “Y” to the prompts
  6. Enter your new sa password when prompted
  7. Wait

That should be it.
Try logging in as “sa” with your new password and you can now are good to go.

Full details of the dbatools can be found here; https://dbatools.io/functions/other/reset-dbaadmin/

VN:F [1.9.22_1171]
Rating: 8.0/10 (1 vote cast)

Categories: SQL Server Tags: