Saturday, March 22, 2014

Visual Studio Online (cloud based TFS): Deleting another user's Workspaces

It is possible for a Visual Studio Online (cloud based TFS) workspace to exist for a user, even after said user has been removed as a valid VSOL user. The specific VSOL instances this happened under was: https://admiralgracehopper.visualstudio.com/

To remove such an orphaned workspace perform the following steps:

1) Open a Visual Studio command prompt, so that "tf" command can be executed. The full documentation for tf can found for Visual Studio 2013 under Use Team Foundation version control commands.

2) Invoke "tf workspaces" for all workspace owners (hence command-line option /computer:*) and all computers (hence command-line option /owner:*):

tf workspaces /computer:* /owner:* /collection:https://admiralgracehopper.visualstudio.com/DefaultCollection

The output for this command will be as follows
Workspace     Owner                Computer      Comment
------------- -------------------- ------------- -------
Contractor-PC Susan Wu             Contractor-PC         
Desktop101    Jan David Narkiewicz Desktop101
LaptopUltra   Jan David Narkiewicz LaptopUltra

The output generated by "tf workspaces" shows a workspace for Susan Wu, the developer who was no longer with the firm.

3) Invoke "tf workspace /delete" to remove the other user's workspace:

tf workspace /delete "Contractor-PC";"Susan Wu" /collection:https://admiralgracehopper.visualstudio.com/DefaultCollection

The workspace and username were specified as: <workspace><semi-colon><username>. Double quotes were used to include the space in the username "Susan Wu" and to make sure that the dash in workspace, Contractor-PC, was interpreted correctly by tf.


1 comment: