TFS Top Tip #2: Changing the Logged In User


Windows User Cache DialogWhen you connect to a Team Foundation Server, the Microsoft client API attempts to connect with your current credentials that the process is running with under Windows.  If you are on a different domain than your TFS server or the user that you are logged in with does not have access, then you will be prompted to enter your login credentials using the standard login dialog box that you will be familiar with from Internet Explorer.

However, what if you pass credentials and now you would like to pass in a different set.  In Teamprise it is easy enough because we have to ask you them every time you connect.  With the Microsoft API your credentials are cached in the standard windows store.

To access this store (and remove your cached credentials allowing you to re-authenticate as a different user) then go to Control Panel, User Accounts, Advanced Tab, Manage Passwords.  You should then locate your TFS Server instance and select Remove.



Good tip, thank you for posting it. Here's another way: Use runas /user:domain\username cmd.exe. This gives you a command prompt as a different user. Then use tf.exe from that command prompt. You can spawn multiple and simultaneous command prompts as various users and party on TFS from each one. Cheers.

Really helped me.


Creative Commons License
This blog is licensed under a Creative Commons License.