5

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.

6

Use Windows Credential Manager.

Create a new Windows credential with the following details:

  • dbservername.domain.com:1433
  • 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"
  • 2
    I have this working without having to create a credential; that step seems redundant. Thanks nevertheless. – 3Dave Apr 12 '11 at 16:18
  • 2
    I have tried this but in my case, the SSMS launches and displays my local account as Username under Windows Authentication. – Hassan Gulzar Jun 21 '12 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.