Problem: I always need to open SQL Server using my admin account but I don't want to keep on doing right click + run as different user, then type my admin username and super long admin password.
My solution? I created a shortcut that launches SQL Server using a different user. Now all I have to do Run "sqlserver" and the app will automatically open using my admin account. Saved me a lot of keystrokes! Hahaha

How:
Create a shortcut to SQL Server with the following target and place it in your User folder.
C:\Windows\System32\runas.exe /savecred /user:domain\surfandperf-admin "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
Create a shortcut to SQL Server with the following target and place it in your User folder.
C:\Windows\System32\runas.exe /savecred /user:domain\surfandperf-admin "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
In detail:
On first launch it will ask for a password, then it will remember it until you change your password.
Hope it works! I really just want fewer clicks and keystrokes for everything hehe.
- Navigate to where your SQL Server executable file is.
Usually it's inside C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\ as ssms.exe - Right click ssms.exe >> Send to >> Desktop (creates a shortcut)
- On your Desktop >> right click the SQL Server shortcut created >> go to Properties >> update the target to this:
C:\Windows\System32\runas.exe /savecred /user:domain\surfandperf-admin "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
Basically I just prepended the target with the red text, making sure to replace the /user:domain\surfandperf-admin part with the domain and username I want to login with.
I used /savecred to save the password for future launches - Move to the shortcut to your user folder and rename it with whatever you want the shortcut name to be. Your user folder is inside C:\Users
On first launch it will ask for a password, then it will remember it until you change your password.
Hope it works! I really just want fewer clicks and keystrokes for everything hehe.