Search code examples
sql-serverssms

Opening SQL Server Management Studio as different user automatically with run or runas commands


I am trying open SQL Server Management Studio as different user than that I am logged in as in the below command but SQL Server Management Studio is opening but not as the User DevAdminAm, it is just opening like my login user not as different user

runas.exe /noprofile /netonly /user:XXXXXtrs\DevAdminAm "C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Ssms.exe"

Can anybody please help me why is it not opening when I save it as batch file and double click it or when I run it as windows command in the startup.

When I run it in startup, it opens SSMS but not as different user as I am intending, any help please.


Solution

  • I got it. Try to set in your credentials manager with these credentials:

    • Server: servername.tld:1433
    • User: domain\account
    • Password: Password of the user domain\account