• #  Wednesday, April 09, 2008

Access Remote SQL Server with SQL Management Studio and Windows Authentication

I've been working with SQL Management Studio since it's release (and even before) and I think it is a very good tool. Especially as in next version there will be IntelliSense.

In my daily work I need to access several remote SQL Servers (over VPN) and some of them require windows authentication. With SQL Server Authentication is easy - just create VPN connection and use SQL Server Management Studio from local machine entering SQL credentials in the wide-known box below:

image

This is not the case with windows authentication. Especially in domain environment it is better to give access to domain groups and users instead of creating SQL ones.

As a workaround (the one I've used 'till today) you can do remote desktop connection to the server and do the job via RDC console. I have struggled with this approach for a long time and although it is not that bad there are some issues working all the time via RDC.

I've tried runas command but somehow my credentials weren't accepted.... but the switch /NetOnly did the job

so I use now

C:\>runas /netonly /user:domainName\userName "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe"

and it works...

Hope this helps


Thursday, April 10, 2008 11:32:04 AM (FLE Daylight Time, UTC+03:00)
Is your computer joined to the AD that you connect to?
Thursday, April 10, 2008 1:26:11 PM (FLE Daylight Time, UTC+03:00)
No, it isn't joined to AD. Maybe this is why it cannot authenticate the runas.
This is where /netonly parameter comes in play - passed credentials are used only on net requests - where exactly I need them. I haven't played if credential authentication is done before net request.
Galcho
Tuesday, August 05, 2008 9:10:19 PM (FLE Daylight Time, UTC+03:00)
I'm stealing this for my blog. :) Credit where credit is due of course.

This worked extremely well for me. Similar situation where I'm not part of the domain (or any domain) but also where I only have TCP port 1433 access to the server. This prevents the other shortcuts of "net use" to the IPC$ service.
Gavin
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview