TFS: Deleting workspaces for other users

I recently was making some changes on a build server to TFS, but was getting an error due to a collision in mappings of working folders between pre-existing workspaces on that machine. I didn’t have access to the account that the pre-existing workspaces where used under, but needed to delete them anyway. I ended up deleting the workspaces by running the following commands from the VS2005 command prompt:
To list tfs workspaces on a machine for all users run the following command:

tf workspaces /server:<tfsservername> /computer:<currentmachinename> /owner:*

To delete a workspaces for any user, run the following command (this may prompt you for credentials – you must run it as a user who has the TFS admin workspaces permission).

tf workspace /delete "<tfsworkspacename>";<username> /server:<tfsservername>

You May Also Like

About the Author: rnowik

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.