Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My SQL Server is set to use Windows authentication. If I am connected to the domain directly from my Windows 7 Ultimate x64 machine, SQL Management Studio (SSMS) will let me authenticate with Windows authentication. However, if I am connected via the VPN (from a different machine that is not joined to the domain), it won't.

If I start SSMS with the following command line:

C:\Windows\system32>runas /netonly /user:domainname\username 
"C:\Program Files (x86)\Microsoft SQL...\ssms.exe"

then connecting to the SQL Server (which is in the domain) with Windows Authentication works fine.

I'd like to save these credentials so that I don't have to launch SSMS from the command line, or modify the shortcut. I know I can use the SysInternals ShellRunAs extension to do this, but I again have to enter my domain username and password each time, and shift+right-click to see that menu option.

The Windows Credential Manager seems designed to solve this problem, and works for network shares. However, it doesn't seem to work for SSMS. Any suggestions?

I've tried using the /savecred option with runas to create the necessary credentials, but that appears to be incompatible with the /netonly option. Running the above command line with the addition of /savecred just displays the runas help screen.

share|improve this question
up vote 5 down vote accepted

Use Windows Credential Manager.

Create a new Windows credential with the following details:

  • domain\UserId
  • Password

Also create a shortcut for SSMS with the following in TARGET:

C:\Windows\System32\runas.exe /user:domain\userid /netonly "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\binn\VSShell\Common7\IDE\Ssms.exe -nosplash"
share|improve this answer
I have this working without having to create a credential; that step seems redundant. Thanks nevertheless. – David Lively Apr 12 '11 at 16:18
I have tried this but in my case, the SSMS launches and displays my local account as Username under Windows Authentication. – DoomerDGR8 Jun 21 '12 at 10:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .