SQL Server Management Studio 2008 Runas user on different domain over VPN

maple_shaft picture maple_shaft · Mar 8, 2011 · Viewed 22.2k times · Source

I am currently trying to run SQL Server Management Studio 2008 as a user who is on a different domain. I noticed in other threads that running the following command from a batch script will do this however it doesn't seem to work for me.

runas /netonly /user:DOMAIN\USER "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

I am asked for my password, the Login screen appears however the Windows Authentication username and password are still incorrectly the currently logged in impersonated user on the local Domain. Attempting to connect to the database on the other domain is unsuccessful regardless.

This seems to work for most people, the kicker for me is that this domain exists over a VPN connection. I am not able to view the VPN domain network computers in My Network Places, and thus I cannot Add Users in Control Panel.

My OS is Vista Business unfortunately, I cannot help this.

Any ideas would be appreciated.

Answer

Ben picture Ben · Mar 19, 2011

Try this:

NET USE \\DBSERVER /USER:DOMAIN\USERNAME

You will be prompted for your password. This establishes a NetBIOS session with the database server. You should be able to see the shared folders and shared printers on the database server once you have done that.

If that works you should be able to connect using SSMS as yourself. You may have to specify "named pipes" as the network protocol to usem, if it doesn't work with TCP (but I think it will).

  • Menu->File->Connect Object Explorer...
  • Options->Connection Properties->Network protocol
  • Specify "Named pipes"

Named Pipes inherits your existing NetBIOS session, so provided you can list the shares you are probably good to go.

Update: It looks like in some configurations this does not work with TCP connections, (possibly due to some security update). In these cases you should enable Named Pipes, and set named pipes in your connection string.