0

I've never considered opening SQL SSMS with any other account, but now that I'm trying to do that, I can't figure out how to do it. This is the panel I'm speaking of:

enter image description here

What must I do to be able to open SSMS with a different domain account? The User name box is greyed out and can't be changed.

Alan
  • 1,587
  • 3
  • 23
  • 43

2 Answers2

3

Find where you have management studio installed on your machine (ssms.exe)

Hold down the shift key and right click it. In the pull down menu you will see the option to run it as a different user.

The shift-right click combo to run as a different user is available for executables and there are registry modification available for Windows 10 users launching apps that do not run for a legacy ".exe"

Travis Acton
  • 4,292
  • 2
  • 18
  • 30
  • I'm fairly certain the "run as" functionality is provided by the OS, not the application. That is, it should work for more than just MS products, but really any executable. – Ben Thul Aug 15 '17 at 02:21
  • @benthul yes, I was speaking a bit to plainly when replying, will update. – Travis Acton Aug 15 '17 at 02:30
2

You would need to open SSMS using the runas command

runas /netonly /user:"domain\user" "C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Ssms.exe"

The "140" part might change depending on your version of SSMS. Warning when you do this, the user box will still show whatever account your login to the computer with but once you connect it'll be logged in with the correct credentials.

I normally put that in a bat file and then just run that to start SSMS.

Element Zero
  • 1,651
  • 3
  • 13
  • 31
  • I tried this and it ran as you said. But all indications after getting past the splash screen and connected indicate I am logged on as the administrator account and not the account I substituted in the batch file. How would I know that I'm actually logged in as the different user? – Alan Aug 15 '17 at 14:41
  • 2
    Yes, it's like a bug in SSMS in my opinion. It doesn't even say the correct user name in the bottom of the query window. If you run "select SYSTEM_USER" though against the server it'll show you who you are currently logged in as. The only reason it shouldn't be the user you specified with the runas is if you mis-typed the password. – Element Zero Aug 15 '17 at 15:00
  • Perfect! And yes, I agree, that approaches the level of a minor bug. If I could trouble you for one other comment. This started because I was looking for the group 'sysadmin'. Is there such a group somewhere, and where do I find it? – Alan Aug 15 '17 at 15:26
  • sysadmin is a server role which would grant a user that belongs to that role all priveleges on the SQL Server. See here: https://learn.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles – Element Zero Aug 15 '17 at 16:05
  • As far as where to find it in SSMS, you can open the server in object explorer and then find it under \Security\Server Roles – Element Zero Aug 15 '17 at 16:06