If you are using the TFS API to get a list of user who have rights in a given version control folder you need to be careful as you don’t get back the domainuser name you might expect from the GetPermissions(..) call. You actually get the display name. Now that might be fine for you but I needed the domainuser format as I was trying to populate a peoplepicker control.

The answer is you need to make a second call to the TFS IIdentityManagementService  to get the name in the form you want.

This might not be best code, but shows the steps required

private List GetUserWithAccessToFolder(IIdentityManagementService ims, VersionControlServer versionControl, string path)
{
    var users = new List();
    var perms = versionControl.GetPermissions(new string[] { path }, RecursionType.None);
    foreach (var perm in perms)
    {
        foreach (var entry in perm.Entries)
        {
                var userIdentity = ims.ReadIdentity(IdentitySearchFactor.DisplayName,
                                                        entry.IdentityName,
                                                        MembershipQuery.None,
                                                        ReadIdentityOptions.IncludeReadFromSource);

                users.Add(userIdentity.UniqueName);
          }
    }

    return users;
}