HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlModerate

How to connect remotely to MSSQL database from local, using windows Authentication?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
localconnectauthenticationmssqldatabaseusingwindowshowfromremotely

Problem

I have to connect remotely to MSSQL database from my local machine, using remote server windows Authentication.

Solution

Assuming you are in a different domain, you can launch SSMS using the remote Windows commercials. Open a command prompt in the folder where ssms.exe lives, and run:

runas /netonly /user:remotedomain\remoteuser ssms.exe


You will be prompted for your password. SSMS will be using remote Windows credentials even though several UI elements will look like you're using the local ones.

This technique should work for launching other executables, like sqlcmd or powershell, but I haven't tested those. I know it works for SentryOne and Plan Explorer.

You can also use Credential Manager, which I wrote about (in addition to more details about runas) here:

  • Connect to SQL Servers in another domain using Windows Authentication

Code Snippets

runas /netonly /user:remotedomain\remoteuser ssms.exe

Context

StackExchange Database Administrators Q#166638, answer score: 10

Revisions (0)

No revisions yet.