Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

up vote 4 down vote accepted

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"
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
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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