Follow sqlserver-dba.com

Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions

SQLServer-DBA.com Links

Dba_db2_button

dba-ninja.com

SQL Server DBA Jobs

How to start SSMS as a different Windows login

04 October,2021 by Tom Collins

Question: I  am logged onto my desktop with my primary Active Directory ID.  I need to log onto a SQL Server with SQL Server Management Studio (SSMS) with another Active Directory ID - the alternative ID has   valid  SQL Server security privileges on the target SQL Server. 

How can I log onto the target SQL Server with the alternative login  , remain on my desktop and use the alternative Active Directory ID ?

Answer:   In an earlier post - How to start SSMS as Administrator ,   there is reference to the RUNAS command. Combining the RUNAS  with the the SSMS command line execute will get the result you need. 

Open the Command Prompt window & use similar to the below examples 

--example 1 : the full path to SSMS
RUNAS /user:mydomain\myaltID "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

--example 2 :  using ssms shortcut 
RUNAS /user:mydomain\myaltID ssms

Once the SSMS is open , you can use some commands to confirm the current login.Returns the name of the login that connected to the instance of SQL Server.

SELECT ORIGINAL_LOGIN();

 


Author: Tom Collins (http://www.sqlserver-dba.com)


Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to start SSMS as a different Windows login


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer