Last week I was asked if I could log into a couple of  SQL Servers were they had lost the SA password and reset it.

The first instance was easy following the steps in this Aaron Bertrand post: http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/

Which is just to run PsExec (part of the SysInternals tools):

PsExec -s -I "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe" 

logged in as a local admin.

The second instance made me think for a minute as the client tools weren’t installed. The solution was simple though thankfully. SQLCMD.  Just follow the same rules as before but run SQLCMD to then create the new SysAdmin account or reset the password.

PsExec -s -I "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\SQLCMD.EXE"

logged in as a local admin.

Advertisements