TFS - How to change the computer name or owner for a workspace

Problem - I recently changed my computer name and the next day I got an error "Workspace YourWorkspaceName; your name does not reside on this computer. If this computer was recently renamed, the workspace may be updated by running ‘tf workspaces/updateComputerName:oldComputerName".

To fix this, open a Visual Studio Command Prompt from program files, and cd to your workspace, then run following

Change the computer name for a workspace

tf workspaces /updateComputerName:<OldComputerName> /collection:<CollectionURL>

You need replace <OldComputerName> to your actual old computer name and <CollectionURL> to your actual TFS collection URL.

Change the owner for a workspace

tf workspaces /updateUserName:<OldUserName> /collection:<CollectionURL>