3

Currently, I'm using SQL Server Management Studio (SSMS) to connect to remote SQL Server. And we are using command-line to connect to that server.

$ path\to\runas.exe /netonly /user:DOMAIN\USERNAME "path\to\Ssms.exe -S ip.xxx.yyy.zzz"

How can I connect to the same remote database using DBeaver ? I kept getting

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

Other info :

  1. Authentication method : Windows Authentication
  2. SQL Server Version : 12.0.5000 SP2
  3. DBeaver Version : 6.2.2.x
  4. There is a prompt for password when we use the command-line.
Mrye
  • 699
  • 3
  • 10
  • 31

1 Answers1

6

For DBeaver, you may need to do the same thing as well into something like this :

$ path\to\runas.exe /netonly /user:DOMAIN\USERNAME "C:\Users\user\AppData\Local\DBeaver\dbeaver.exe -nl en"

Then, from DBeaver New Connection change the SQL Server authentication to Windows Authentication. It will use the username that we pass from runas.

Mrye
  • 699
  • 3
  • 10
  • 31
  • Is there a way use `runas` in a shell command before you connect with the built in DBeaver tools? – Foggy Feb 09 '22 at 21:02
  • 1
    you can run `path\to\runas.exe /netonly /user:DOMAIN\USERNAME cmd`. It will open a new cmd prompt. Any command run in there will use this domain username. Not sure if this is want you want though. – Mrye Feb 10 '22 at 14:44