TFS Q&A - Changing service accounts and adding users from the command line
Question: We installed TFS with using local accounts. We now need to add domain accounts into TFS and this requires that the TFS services accounts use a domain account. How can we change these accounts without a reinstall?
Answer: Check out TFSAdminUtil – a command line utility. See http://msdn2.microsoft.com/en-us/library/ms253116(VS.80).aspx for more information.
Question: How do I add a user to a TFS Group from the command line?
Answer: Use the tfssecurity.exe command line tool
Eg:
add a domain user to the Project Administrators Group:
tfssecurity /server:servername /g+ "[Project Name]\Project Administrators" n:Domain\username
add a domain user to the Server level “Team Foundation Administrators” Group:
tfssecurity /server:servername /g+ "[server]\Team Foundation Administrators" n:Domain\username
remove a domain user from the Server level “Team Foundation Administrators” Group:
tfssecurity /server:servername /g- "[server]\Team Foundation Administrators" n:Domain\username