I am trying to use the tf.exe destroy command to remove the history for a branch, and get error TF14127
which means
cannot destroy because a file is being used by a shelveset.
Destroy command being used is:
tf.exe destroy $path /keephistory /startcleanup /silent /noprompt /stopat:D01-08-2018
So I try to delete the shelveset with tf vc shelve delete "shelveset-name;username", but that returns
the shelveset cannot not be found
So, I look for it using tf vc shelvesets /owner:"username", and this is where I finally get to the root cause, with
TF14045: The identity username is not a recognized identity.
So I ask my domain admin guy, and sure enough that user was deleted (not just disabled) in a cleanup last year ...
So, am I stuck, or is there a way to delete a shelveset for an invalid identity?
NOTE: we are using TFS Server 2018 R2, and the Tf.exe is 2017 (Version 15.129.27825.1).
The solution here was in the end simple: the user's name was, for example, "Fred Bloggs", and this is the name that was reported in the TF14127 error.
But, the user's identity is actually just "FredB", and [tf vc shelvesets /owner:"FredB"] was able to find his shelvesets.
So, the error message is misleading, using the users full name (Given Names and Surname), not the username that needs to be used to find shelvesets.
Ended up using Team Foundation Sidekicks to find and delete the shelveset.