Clean old and unused workspaces and shelves from your TFS

The command line utility "tfsclean.exe" helps  with two scenarios:

  • You want to find and delete old worspaces and shelvesets (oder than XX days).
  • You want to find and delete workspaces and shevlesets from a certain user
    (e.g. when the user left the company)

Caution: There’s no way to recover a shelveset once it is deleted.


tfsclean.exe /collection<URI> [/delete] [/maxage:n] [/username:text] [/excludeworkspaces] [/excludeshelvesets]

Required parameters:  
/collection:<URI> URI of Team Project Collection (e.g. http://servername:8080/collection)
Optional parameters:  
/delete Required to actually delete items (otherwise it runs in readonly mode)
/maxage:<number> Specified the maximum age in days (default is: 365)
/username:<name> Only clean items from specified user (e.g. DOMAIN\username)
/excludeworkspaces Do not clean workspaces.
/excludeshelvesets  Do not clean shelvesets.

tfsclean cleans up old workspaces and shelvesets

(Note: The user needs to have the ‘Administer workspaces‘ and ‘Administer shelved changes‘ permission on TFS)

Download the tool from here:

Prerequisite: This tool requires Team Explorer to be installed.


6 thoughts on “Clean old and unused workspaces and shelves from your TFS”

  1. Hallo Neno,

    Danke für den bunten Frühlingsstrauss an Tools, den Du uns da in den letzten Tagen präsentiert hast!


  2. @Fred: Es kommt noch mehr dort, wo diese kleinen Dinger herkommen, die bisher nur ein Schattendasein auf meiner Festplatte leben durften…

  3. Jean-Rene: What exactly do you want to “clean”? Members of the contributors group? Do you have so many that you don’t want to use the dialog to achieve this? On what criteria would you want to remove them?


Leave a Reply

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


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>