Visual Studio and Windows authentication from different domains

3. February 2011

I am not sure how many people have tried to connect there personal computer or their work computer to a different domain and use TFS with it but it prompts for user credentials every time. This is a bit annoying especially when you have to punch in the domain every time. There is also the trouble of debugging with a windows authenticated website from the wrong domain. These are fairly common problems for consultants, contractors, and work from home guys who want to use their powerhouse rather than the dinky work laptop. Here is the solution.

 

Create a new short cut and add this to the target

image

C:\Windows\System32\runas.exe /user:<domain>\<user> /netonly "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"

That is for Visual Studio, You can also do this to hit windows authenticates sql servers from Sql Manager which doesn’t allow you to punch in a different windows user.

C:\Windows\System32\runas.exe /user:<domain>\<user> /netonly "C:\program files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

 

These two shortcuts have saved me tons of time in the last several weeks. Feel free to share!

Visual Studio 2010