Is it possible to log in to another Windows account using SQL Server Authentication?

If I want to log in to an instance of SQL Server using a different Windows account, I can do this simply by selecting "SQL Server Authentication" as the authentication mode and enter DOMAIN/username and password for the account I want to use

Are there any special settings I need to set in order to make this work?

+4
source share
3 answers

No. "SQL Server Authentication" only works with SQL Server inputs, it will not work with NT input. To log in as another credential, the process starts as the credentials you want to run. Use runas , most likely you want to start SSMS as follows:

 runas /netonly /user:domain\user "c:\program files\...\ssms.exe" 

By specifying the /netonly argument, your SSMS will start with the required NT credentials only for remote hosts, the local credentials will be local. This not only saves your SSMS environment (last used files, parameters, etc.) and does not require domain\user have local privileges, but more importantly, it works even for a completely unrelated domain . That is, if you work in the foo domain (or do not even join the domain), and the required runas are in the bar domain, runas /netonly /user:bar\user ... will work fine.

The /netonly trick only works if the host of the SQL server you are connecting to is remote (not on the same computer). If local, then your runas should be local using the required credentials, so remove the /netonly argument.

+7
source

If you have Windows 7, you can add credentials for other domains through Control Panel> Administrative Tools> Credential Manager. Match your credentials on each server you want to login to.

Then log on to additional machines using Windows Authentication. I think there is a caution - it will try to connect you to the server using your current domain / username. IF this is rejected, he will look for any entries that you have for this server in Credential Manager, and if they are valid, you will be logged in.

0
source

If I understand the question correctly, the solution that it just sends + Right-click on SSMS, which will give you the option to "connect as another user" and where you want to put your Windows authentication. Domain \ User and Password.

-2
source

Source: https://habr.com/ru/post/1393010/


All Articles