none
How to change the owner of a workspace

    Question

  • Hi, how can I change the owner of a workspace without deleting the workspace and create a new one?

    Thanks

    Tuesday, July 07, 2009 2:09 PM

All replies

  • there is a tf.exe command that you may want to try.

    tf workspaces /updateUserName:OldUserName /s:http://Tfs_server:8080

    the tf.exe is located in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE

    -paul

    Paul Hacker
    Tuesday, July 07, 2009 3:20 PM
  • I forgot to add OldUserName should be replaced with your user name prior to changing it.
    Paul Hacker
    Tuesday, July 07, 2009 3:24 PM
  • Ok but I want to change the owner to someone else then myself.
    Tuesday, July 07, 2009 5:04 PM
  • You have to log in to the computer with the new user, and then execute the command passing the old user into OldUserName. The workspace owner will be changed to the user who has logged in.

    But that command will only work if the user has been renamed (but the SID is the same). If it's a completely different user, it won't work. In that case, I know about two possible options: using a shelveset or the TFS power tools.

    With the shelveset option, you simply shelve the entire workspace of the old user and unshelve it over the workspace of the new user.

    If the shelveset option doesn't work for you, you can try using the TFS Power Tools (http://msdn.microsoft.com/en-us/teamsystem/bb980963.aspx ), which include the tfpt.exe command line utility. You can try to pend the changes using "tfpt online"; it would be something like the following:

    • Create a new workspace for the new user (mapping it but without getting any code into it), and copy everything in your old user's workspace to the new one.
    • Open a command prompt, go to the workspace folder and run "tfpt online /recursive". If you have added or deleted files, use "tfpt online /recursive /adds /deletes"
    • You should be prompted with a list of changes to be pended. You can compare that list with the pending changes of your old workspace to see if everything is ok. When you're done with the comparison, hit the button "Pend changes"
    • You should end with a workspace with (almost) the same pending changes that you had in your old workspace
    But I should definitely try the shelveset option, it's much simpler.


    Hope it helps...

    Best regards
    Tuesday, July 07, 2009 8:01 PM
  • I agree you should use a shelveset in this situation.  Before you can do so, though, you need to create a 2nd workspace for the new user.  The best way is to use tf workspace /new <name> /template:<oldname>;<olduser>
    Wednesday, July 08, 2009 8:01 PM