The Problem
As consultants, we often run into instances where we need to connect to a Microsoft SQL database as a user from another domain. Using SQL Server Management Studio fails the login because we can’t specify which domain credentials to use, just that we want to use them. Naturally, it defaults to the domain credentials of the logged on user. We run into the exact same issue with Tableau Desktop. Even if we specify “DOMAINusername” as the user, authentication fails.
I’m sure we’ve all found a workaround, such as installing Tableau on a machine that belongs to the domain, or enabling SQL Server authentication rather than Windows Authentication. There has got to be a better way.
The Better Way
A little known trick in Windows is the ability to run a program as another user. A lesser-known trick is the ability to run a program as an arbitrary user on any domain at all. Make your way to a command prompt and follow along:
- To make it easy on yourself, change directories to the directory where tableau.exe is located.
- Type in this command: runas /netonly /user:DOMAINusername tableau.exe
- Within the new Tableau Desktop window, connect to the database using Windows Authentication
This works with any program that passes the current user’s credentials to the data source, so it will also work with SSMS.
Happy vizzing!