When setting up a new user using Team Foundation Server, I got an error saying “The path … is already mapped in workspace …” The workspace listed belonged to another user that had previously used the computer. I was able to remove the previous user’s mapping with the command:

tf workspace /delete /collection:"TFSCollectionURL" workspace;owner

Since TFS considers both the computer name and the owner when comparing workspaces, there are a few things to remember:

  • If a computer is going to a new user and the computer name has not changed, the workspaces tied to this computer that belong to the previous owner should be removed.
  • If a user is getting a new computer and the computer name has changed, the user will need to configure new workspaces on the new computer or update the computer name associated with the workspace before they will be able to access the workspace on the new computer. You can update the computer name for a workspace by running this command on the new computer: 

tf workspaces /updateComputerName:oldComputerName workspacename /collection:"TFSCollectionURL"