On my current contract I have to develop and support SSIS packages for multiple versions of SQL server and in order to work with multiple versions, I am running a virtual machine.
The problem with virtual machines they are not connected to active directory, and in most cases, I need to connect to SQL Server using Management Studio using Windows Authentication.
Usually in the past, when I need to run the application under a different account, I used ShellRunAs application from Sysinternals, it creates a nice context menu which allows to type credentials for the different user, but in this case, it did not work, because I was running it from the virtual machine. It complained that "The username or password is incorrect".
The solution for this issue is to provide an additional parameter to ShellRunAs application
The problem ShellRunAs accept this parameter when it runs from command line and there is no UI to run the application with that command. But this can be fixed by creating another context menu item which will have such a parameter.
ShellRunAs registered for multiple file formats under Shell key in Windows registry. For example, for *.exe files, it registered at
it also registers for link files and msc files (Microsoft management console)
The registry files need to be modified for your system to use the correct location where ShellRunAs.exe file is located, in my case it's
Now, after I have executed registry files, I can see another context menu
Executing Microsoft SQL Management studio under domain account from non-domain computer
If you like command prompt, the same can be achieved using RunAs command, it does not have GUI but works absolutely the same (you can use both Powershell and Cmd). On the sample below I am running Microsoft Management Studio from a machine not connected to the domain
PS C:\> runas /netonly /user:firstname.lastname@example.org "C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe" Enter the password for email@example.com: Attempting to start C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe as user "firstname.lastname@example.org" ... PS C:\>
As a result after my SQL Management studio starts I am able to access all database under my domain account and SQL Management studio is actually running under my domain account