Posted on Leave a comment

Recovering access

Local admins can get into instance when sysadmin access has been lost by starting the server in single user mode.   Here is how recover a sysadmin account without having to restart.  Prior to 2008 BUILTINAdministrators was by default a member of sysadmin.   In 2008/2008R2 that login was not added by default, but NT AUTHORITYSYSTEM still is.


psexec -s -i cmd

sqlcmd

create login [login] from windows
go

exec [sys].[sp_addsrvrolemember] 'login', 'sysadmin';
go

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.