Connect different Windows User in SQL Server Management Studio (2005 or later)

后端 未结 9 1733
我寻月下人不归
我寻月下人不归 2020-11-30 16:03

Is there a way in SQL Server Management Studio 2005 (or later) to change the Windows Authentication user (as you could in SQL Server 2000 and older)?

This is the gen

相关标签:
9条回答
  • 2020-11-30 16:42

    While there's no way to connect to multiple servers as different users in a single instance of SSMS, what you're looking for is the following RUNAS syntax:

    runas /netonly /user:domain\username program.exe
    

    When you use the "/netonly" switch, you can log in using remote credentials on a domain that you're not currently a member of, even if there's no trust set up. It just tells runas that the credentials will be used for accessing remote resources - the application interacts with the local computer as the currently logged-in user, and interacts with remote computers as the user whose credentials you've given.

    You'd still have to run multiple instances of SSMS, but at least you could connect as different windows users in each one.


    For example: runas /netonly /user:domain\username ssms.exe

    0 讨论(0)
  • 2020-11-30 16:46

    The runas /netonly /user:domain\username program.exe command only worked for me on Windows 10

    • saving it as a batch file
    • running it as an administrator,

    when running the command batch as regular user I got the wrong password issue mentioned by some users on previous comments.

    0 讨论(0)
  • 2020-11-30 16:49

    None of these answers did what I needed: Login to a remote server using a different domain account than I was logged into on my local machine, and it's a client's domain across a vpn. I don't want to be on their domain!

    Instead, on the connect to server dialog, select "Windows Authentication", click the Options button, and then on the Additional Connection Parameters tab, enter

    user id=domain\user;password=password
    

    SSMS won't remember, but it will connect with that account.

    0 讨论(0)
提交回复
热议问题