Thursday, December 1, 2011

Connect to SQL across domains using Windows authentication

To connect from desktop on DOMAIN1 to SQL instance hosted on DOMAIN2
runas /netonly /user:domain\username program.exe
Example:
runas /netonly /user:DOMAIN2\username "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

After being prompted for the password, the following screen comes up.

Enter the following:
SQL Instance: 12.12.123.123 (IP Address)
Authentication: Windows Authentication

Even though the DOMAIN1 domain account shows up greyed out and shows DOMAIN1\username on the left Object Browser, it will connect with DOMAIN2\username credentials as shows on the right.

The same method can be used for any program.


http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx?mfr=true


http://www.olegsych.com/2009/05/crossing-domain-boundaries-windows-authentication/


http://stackoverflow.com/questions/849149/connect-different-windows-user-in-sql-server-management-studio-2005-or-later

No comments:

Post a Comment