Friday, March 8, 2013

Cross domain access via windows authentication for SQL server



“Ohh.. eh… Why I cannot connect to this SQL server with windows authentication hosted on other domain. I tried everything but that is not working. :( :( ”
Ever caught in a situation like this?
Once I was also caught up in a problem similar to this one. I needed to access SQL server hosted on other domain and we had only one server from which we could access that and the number of people using the server was very high 5-6. So, it was not possible to login into machine simultaneously.
We then find a solution to launch SQL server client at our local desktops under that other domain. That invocation under separate domain is a bit tricky and works on “RUNAS” command.

All one have to do is follow below mentioned steps:

1.       Open command prompt
2.       Type following command RUNAS /user:<Domain name>\<Username> /netonly ssms
e.g. RUNAS /user:otherdomain\myuser /netonly ssms
3.       Provide username and domain in above command as shown in example
4.       Press enter
5.       Enter password when asked as displayed in below screen.
6.       Now your SQL server management studio will launch. Provide the database name hosted on other domain in the server name.
7.       Select authentication as windows authentication. It will display your local domain, ignore that.
8.       Click on connect
9.       On first attempt you might get timeout error but on second attempt you will be able to connect directly.

No comments:

Post a Comment