My System Administrator renamed my computer. So where it was \"MyLaptop2\" it is now just \"MyLaptop\".
So now all my source control bindings and checked out files
Vaccano's solution worked for me. It took me several tries to get the TFS URL right, so I thought I'd post it for those of you who are using Microsoft's Visual Studio TFS hosting (currently free for small teams).
From a command prompt on my computer, I first changed to the right directory:
cd c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
Then I ran the command:
tf workspaces /updateComputerName:OLDCOMPUTERNAME /s:"https://MYCOMPANY.visualstudio.com/DefaultCollection"
It then told me that my new workspace matched the machine name of my new computer name.
Hope the path helps.
I tried running the commands mentioned in the other answers; however, my project is hosted in TFS online (visualstudio.com) so I needed to authenticate first since I kept getting this error message:
TF400813: Resource not available for anonymous access.
For me it was just easier and much faster to remove the worskpace and reconnect again:
File > Source Control > Advanced > Workspaces (remove workspace)
I had the same problem and came here. But then I just closed and reopened visual studio and it was fine. So... that might be the solution for some.
Go to VS command prompt and type the following:
tf workspaces
This will provide you with the available Collections. Copy the path (essentially a URL) of your intended collection. Then type the following:
tf workspaces /updateComputerName:"OLD_NAME" /collection:"The URL copied from above"
(exclude the quotes above)
Just to clarify for users of TFS Online (MS hosted TFS) - if your url was "mytfs.visualstudio.com" and your collection is "DefaultCollection", the commands as listed above will be:
To list all workspaces: tf workspaces /owner:* /computer:* /server:https://mytfs.visualstudio.com/DefaultCollection
To update from OldPcName: tf workspaces /updateComputerName:OldPcName /server:https://mytfs.visualstudio.com/DefaultCollection
In short, specify HTTPS, ignore the port and don't add a /tfs/ folder structure.
You can then select (and rename if desired) the workspace by going to source control explorer and using the Workspace drop down.
This command run in the Developer Command Prompt for Visual Studio 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.