How to Delete a Team Foundation Server Workspaces:

some times some of  your project files are checked in to a workspace which do not exists any more, or you are getting build failed error as source is already mapped to a workspace.

Solution is to delete the workspace.

I searched a lot a simple way to delete the workspace using the “Team Foundation Administrator Console” but there isn’t. The GUI interface for TFS management do not have any way to manage Team foundation server and things like this (deleting workspace) are done using command s.

Login to windows server and open “Visual Studio Command Prompt”  and issue following command.

>
> tf workspace /server: ServerName /delete WorkspaceName
>

This should delete the workspace you mentioned at the end of command.

There are many commands of TFS like list all workspaces.

The following example displays a list of all workspaces for the current user on the current computer.

>
> tf workspaces
>

The following example displays the list of all workspaces for all users on all computers that have been created in the following team project collection at the address http://myserver:8080/tfs/DefaultCollection.

>
> tf workspaces /owner:* /computer:* /collection:http://myserver:8080/tfs/DefaultCollection
>

The following example displays detailed information about all workspaces that the current user has created in the team project collection at the address http://myserver:8080/tfs/DefaultCollection.

>
> tf workspaces /computer:* /format:detailed /collection:http://myserver:8080/tfs/DefaultCollection
>

The following example displays detailed information including a list of workspace mappings about the workspace “WS1,” which is owned by the current user and is located on the current computer.

>
> tf workspaces /format:detailed /collection:http://myserver:8080/tfs/DefaultCollection WS1
>

The following example removes all cached workspaces from the cache in the team project collection at the address http://myserver:8080/tfs/DefaultCollection.

>
> tf workspaces /remove:* /collection:http://myserver:8080/tfs/DefaultCollection
>