I’ve run into this problem several times. A build blows up for some reason and creates an orphaned workspace. Other builds then fail with the message The path […] is already mapped in workspace […].
The way that I’ve dealt with this in the past is to simply delete the workspace, which you can do easily enough by using the tf workspace command.
tf workspace /delete someworkspace;somedomain\someuser
When you run the command, you’ll be warned that deleted workspaces cannot be recovered and prompted to confirm.
Type “Yes” and the deed is done. Run another build, and you should be good!
I found a third party tool that can delete multiple work spaces called Team Foundation Sidekick from Attrice Corporation. I have used it to clean up work spaces of former employees and even current employees that have invalid work spaces because of new computers. The tool queries the TFS database using a few parameters and returns the results in a grid.