Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add yourself to the Administrator Group on a SQL Server

T-SQL Hints and Tips

How to add yourself to the Administrator Group on a SQL Server

by  DBAWinnipeg  Posted    (Edited  )
I have found this script useful for emergency on-call situations where I need to get onto a server that I am currently not a member of the local administrators group.

Code:
xp_cmdshell 'net localgroup Administrators DOMAIN\UserName /ADD'
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top