Warm tip: This article is reproduced from stackoverflow.com, please click
tfs

Remove Inactive User from Team Foundation Service Accounts group

发布于 2020-04-07 10:23:36

I know we can add/remove users for Team Foundation Service Accounts group using TFSSecurity command

for example - tfssecurity /g- "[TEAM FOUNDATION]\Team Foundation Service Accounts" n:DOMAIN\username /server:https://tfs.mycompanydomain.com/tfs

When I try to remove inactive user (the AD user left the organization) I am getting Error: The identity cannot be resolved.

How can I remove inactive user from "Team Foundation Service Accounts" group. Any help would be highly appreciated.

TFS version : 2017

Questioner
san
Viewed
58
PatrickLu-MSFT 2020-02-03 18:13

Since that user is inactive (the AD user left the organization).

Please execute the command tfssecurity /imx “username” /collection:url, then view the result to check this user existing in which group(s) in your collection. Ensure your removed this user from all the TFS groups.

If you are also not able to remove him from other group. You could try to use User ID instead of domain name.

tfssecurity /g- "[TEAM FOUNDATION]\Team Foundation Service Accounts" n:userID /server:https://tfs.mycompanydomain.com/tfs

The UserId is stored in Tfs_Configuration database. If you want to know your ID, you could ask your TFS administrator to check the [dbo].[tbl_Identity] table to get your UserID.