13
votes

I am connecting to TFS through Visual Studio 2008 Team Explorer. Lets say TFS is on machine A and Visual Studio 2008 is on machine B (my box). I have a local account on machine A (i.e. A\username) that has admin privileges for TFS (installed on machine A). Whenever I connect to TFS from team explorer it always uses the my domain credentials (companydomain\username) to connect to TFS. I want to be able to specify a different account (i.e. A\username) while connecting.

How can this be done? Thanks.

Also solutions similar to below do not work for me since there is no entry present in the "Manage password" dialog.

http://blogs.msdn.com/davidmcg/archive/2007/05/25/changing-team-foundation-server-credentials.aspx

6
Yes. I tried runas. But since the account is not part of the domain it gives the message "unable to log on: Logon failure: unknown user name or bad password"stackoverflowuser
Have you tried manually adding an entry for TFS in Stored User Names and Passwords and specifying the credentials (A\username) there?Helen
The runas command has a switch that allows for the behavior you're looking for - see my answer.SqlRyan

6 Answers

19
votes

I think you're looking for the RUNAS command with the /NETONLY switch:

runas /netonly /user:domain\username program.exe

When you use the "/netonly" switch, you can log in using remote credentials on a domain that you're not even currently a member of, even if there's no trust set up. It just tells runas that the credentials will be used for accessing remote resources - I believe the application interacts with the local computer as the current user, and interacts with remote computers as the user you've given.

4
votes

Clear the user's credentials in the Credential Manager. This will then bring back the Authentication Window when trying to connect to TFS.

1
votes

Also solutions similar to below do not work for me since there is no entry present in the "Manage password" dialog.

http://blogs.msdn.com/davidmcg/archive/2007/05/25/changing-team-foundation-server-credentials.aspx

You should be able to add a new entry. More detailed instructions: http://weblogs.asp.net/srkirkland/archive/2009/09/24/save-your-codeplex-repository-credentials.aspx

1
votes

In Windows 7, you can do a Shift Right click on the Visual Studio 10 icon and get the "Run as different user" option. That will bring up a logon dialog where you can specify the user's credentials.

0
votes

You could try connecting to the TFS machine using windows explorer before you connect via TFS. When you connect to the machine use the "connect as" option to specify the user that you want to connect with.

If that does not work try mapping a drive using "connect as".

0
votes

You can try the "Run As" option. Instead of d-click the devenv icon, right click on it and choose "Run As".