Hi ,
I need to login to my database by using windows authentiation but i need to change user.
I have tried below options and yet it not worked. Can anyone please assist me on this?
1. Run As different User -> not visible
2. Unable to change user once i selected windows authentication
3. executed this command line - runas /user:DomainName\Username "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"
But i unable to type password in CLI.


Sangeetha SRank #212 · 11.4K reputationPosted Jan 29, 2025, 3:38 AM EST
Trying to log into SQL Server Management Studio (SSMS) using a different Windows account but encountering some issues. Here are a few steps and tips that might help you successfully log in using Windows Authentication with a different user account:
Using Run as Different User:
Using the Runas Command:
Using Task Manager:
Check SSMS Settings:
Use a Different Tool:
Group Policies:
Tuhin PaulRank #7 · 71.9K reputationPosted Jan 29, 2025, 1:15 PM EST
Part - 1
When using Windows Authentication to log in to SQL Server Management Studio (SSMS), the credentials of the currently logged-in Windows user are used by default. If you need to switch to a different Windows user, you can use the
runascommand, but there are some nuances to consider.Using runas Command
Open Command Prompt as Administrator:
Press
Win + Xand select Command Prompt (Admin) or Windows Terminal (Admin).Run the
runasCommand:Use the following command to launch SSMS as a different user:
runas /user:DomainName\Username "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"Enter the Password:
After running the command, the CLI will prompt you to enter the password for the specified user. Type the password and press
Enter.Verify SSMS Launch:
If the credentials are correct, SSMS will launch under the specified user account. You can now connect to your database using Windows Authentication with the new user.
Tuhin PaulRank #7 · 71.9K reputationPosted Jan 29, 2025, 1:28 PM EST
Part -2
Using runas with /netonly
If the above method doesn't work or you cannot type the password, you can use the
/netonlyflag. This allows you to run SSMS under your current user but authenticate to the SQL Server using a different Windows account.Open Command Prompt as Administrator.
Run the
runasCommand with/netonly:runas /netonly /user:DomainName\Username "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"Enter the Password:
When prompted, enter the password for the specified user.
Connect to SQL Server:
Launch SSMS and connect to your SQL Server using Windows Authentication. The connection will use the credentials provided in the
runascommand.Tuhin PaulRank #7 · 71.9K reputationPosted Jan 29, 2025, 1:30 PM EST
Part - 3
Use a Different Windows User Profile
If the above methods don't work, you can switch to a different Windows user profile:
Log Out of Current User:
Log out of your current Windows session.
Log In as the Desired User:
Log in to Windows using the credentials of the user you want to use for SQL Server authentication.
Launch SSMS:
Open SSMS and connect to your database using Windows Authentication.