How to change the computer name and update the owner name for a workspace
As part of the information about a workspace, the version control server records the name of the computer that hosts a workspace and the user that owns the workspace. If you need to change your computer name or your user name, how do you tell the server to update the workspace information?
The command line, tf.exe, provides two options, /updateComputerName and /updateUserName, on the workspaces command to address this issue. Note that in version 1 you must use the command line for this. Also, you may notice that the documentation on MSDN shows that these options do not accept values, but that’s a documetation error that will be corrected in the near future.
To update the computer name for workspace, you’ll need to run the following command.
tf workspaces /updateComputerName:OldComputerName /s:http://Tfs_server:8080
OldComputerName should be replaced with the name your computer had previously (more precisely, it should be what the server currently has recorded). Tfs_server should be replaced with the name of your server.
When you execute that command, tf.exe removes the cached workspace entries that use the old computer name, calls the server to tell it the current computer name, and gets the current list of workspaces owned by you on the current computer.
Similarly, you’ll need to run the following command if your user name changes (for example, from corpdomaineharris to corpdomainesmith).
tf workspaces /updateUserName:OldUserName /s:http://Tfs_server:8080
OldUserName should be replaced with your user name prior to changing it.
As with updating the computer name, tf.exe uses the old user name to clear out the workspace entries where the owner is the old user name, tells the server to update your user name, and gets the current list of workspaces owned by your current user name.
The server actually stores the Windows SID (security identifier) for your account, so the update call to the server simply tells the server to update its cache with the current user name for that SID. That also means that if you get a new user ID rather than just changing the name, you won’t be able to update the workspace ownership this way. In that case, you’ll have to create a new workspace.
You can find the complete command line reference documentation at http://msdn2.microsoft.com/en-us/library/cc31bk2e(vs.80).aspx.
To use /updateComputerName and /updateUserName, you must use the RC or newer release of TFS.