52

I renamed my computer name, and now my TFS workspace is broken in Visual Studio 2012.

When I type:

tf workspaces /computer:ABOTONJIC-PC /owner:* /format:detailed

Workspace  : ABOTONJIC-PC
Owner      : wrongowner@test.com
Computer   : ABOTONJIC-PC
Comment    :
Collection : netuse.visualstudio.com\DefaultCollection
Permissions: Private
Location   : Local
File Time  : Current

But I need to have :

Owner      : realowner@test.com
Computer   : NEW-PC

Then I try:

tf workspaces /updateComputerName:ABOTONJIC-PC /collection:netuse.visualstudio.com/DefaultCollection

No workspace matching *;wrongowner@test.com on computer NEW-PC found in Team Foundation Server netuse.visualstudio.com/DefaultCollection.

So my question are :

  1. How to update computer name in my workspace?
  2. Why TFS still shows "wrongowner@test.com" in workspace although there is new email registered as "realowner@test.com"?
shA.t
  • 16,580
  • 5
  • 54
  • 111
Jalle
  • 1,566
  • 5
  • 22
  • 42
  • 1
    possible duplicate of [Change computer name for a TFS Workspace](http://stackoverflow.com/questions/8435135/change-computer-name-for-a-tfs-workspace) – Edward Thomson Jul 04 '13 at 14:40

11 Answers11

49
  1. Install Team Foundation Sidekicks. It's free.
  2. Open the Workspace Sidekick, click Search, and select your workspace from the list.
  3. Click the blue computer icon to Update Workspace Computer Name and you're done.
Anthony Faull
  • 17,549
  • 5
  • 55
  • 73
  • Is there any way to know which command the sidekicks application is executing? I'm curious about the command it is using... I can't seem to figure out the command line option needed to do this. – DigitalZebra Aug 06 '13 at 17:47
  • 1
    This was huge. Thanks. I'm spreading the word around my group. Computer name changes are a sticky one. – sleath Apr 20 '15 at 14:47
  • 1
    For Visual Studio 14, or using windows 8.1 + , no function. – LKF Mar 21 '16 at 21:27
  • great tool. some very useful stuff . – Praxiom Dec 07 '22 at 07:13
49

I installed Sidekicks. It did not work for this issue, but this did:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE>tf workspaces /updateComputerName:OldComputerName /s:"https://tfsServerName"
Anthony Faull
  • 17,549
  • 5
  • 55
  • 73
J Brun
  • 1,246
  • 1
  • 12
  • 18
  • 1
    You need https vs. http in the server name above to make this work. It wouldn't let me edit the post since an edit needs at least six characters which i really dumb when you are discussing programming and lines of code. – jaredbaszler Apr 16 '15 at 14:48
  • 7
    For the /s part i had to enter `http://servername:8080/tfs/projectcollectionname` , substituting in my servername and projectcollectionname. – pseudocoder Jul 28 '16 at 22:32
32

I had the same issue, also a VisualStudio.com account.

I've tried what the prompt told me :

enter image description here

Like so :

tf workspaces /updateComputerName:MyOldComputerName

but I got back :

The /collection option must be specified whenever /updateComputerName or /updateUserName is specified.

In order to get the collection name I ran :

tf workspaces

which listed my collections and I got the name of my collection (...myusername.visualstudio.com...)

Then I ran :

tf workspaces /collection:http://myusername.visualstudio.com /updateComputerName:MyOldComputerName

Didn't work as I got this:

TF31002: Unable to connect to this Team Foundation Server: http://myusername.visuals tudio.com/defaultcollection. Team Foundation Server Url: http://myusername.visualstudio.com/defaultcollection.

Possible reasons for failure include: - The name, port number, or protocol for the Team Foundation Server is incorrect - The Team Foundation Server is offline. - The password has expired or is incorrect.

Technical information (for administrator): The remote server returned an error: (404) Not Found.

Then I noticed that I've typed http instead of https, corrected, retried and it worked!

Andrei Rînea
  • 20,288
  • 17
  • 117
  • 166
16

In

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>

run in CMD as admin this command

tf workspaces /collection:https://SERVER_NAME.visualstudio.com/DefaultCollection /updateComputerName:OLD_COMPUTER_NAME
Petr Voborník
  • 1,249
  • 1
  • 14
  • 11
8

To get this to work in Visual Studio 2017 use the following (new location)

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe workspaces /collection:https://youraccountnamehere.visualstudio.com /updateComputerName:OLD-COMPUTERNAME

Hope this saves someone some time!

Andrew
  • 9,967
  • 10
  • 64
  • 103
4

Look at this link

Vaccano said :

This command did the trick:

tf workspaces /updateComputerName:MyOldComputerName 
/s:"http://MyServer:8080/tfs/MyCollection"

It had to be run from the computer I wanted to assign the workspace to (that is how it gets the new computer name. >

Community
  • 1
  • 1
Ardalan Shahgholi
  • 11,967
  • 21
  • 108
  • 144
3
tf workspaces /updateComputerName:REPLCATEOLDCOMPUTERNAMEHERE /collection:REPLACETFSURL

example:

tf workspaces /updateComputerName:DESKTOP-42CLO97 /collection:https://testuserxx.visualstudio.com

VS2017

AliReza Sabouri
  • 4,355
  • 2
  • 25
  • 37
2

Open Command prompt and type as shown in below

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE

enter image description here

and type the following code with your credential

tf workspaces /updateComputerName:OldComputerName /s:"https://tfsServerName"

In CMD prompt

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>tf workspaces /updateComputerName:OldComputerName/s:"https://tfsServerName"

PK-1825
  • 1,431
  • 19
  • 39
1

You can add new workspace then use vs 2017 delete your previous workspace: enter image description here

Alan
  • 169
  • 1
  • 3
0

Open the visual studio command prompt and type the following command

tf workspaces /updateComputerName:oldcomputername  /s:http://tfservername:port#/tfs

for example

tf workspaces /updateComputerName:abc-PC  /s:http://mytfsserver:8080/tfs

You can run the following command before and after running the above command, this is just to check the workspaces information on your computer.

Remember: run all these commands on client computer (which is renamed) and not on the computer where TFS server is installed.

If user name is also changed then run the following command

tf workspaces /updateUserName:oldUserName  /s:http://mytfsserver:8080/tfs

Hope it will help.

Sachin
  • 2,152
  • 1
  • 21
  • 43
Abdul Rauf
  • 962
  • 2
  • 10
  • 22
0

What worked for me was typing

tf workspaces /updateComputerName:MyOldComputerName /collection:"anything".visualstudios.com/DefaultCollection/
Aman Gupta
  • 17
  • 4