I can use TFSCONFIG IDENTITIES to see all users in TFS, however, that pulls up accounts that are years old and no longer have an AD account tied to it. I want to limit search to only people that have an AD account. Is this possible? I did find blog below, but before I try that I wanted to see if there was a powershell script or TFS command that would provide what I needed. thanks.
There is no such TFS command line could handle this situation. Afraid you have to go through the collection database level in TFS to obtain related info.
You could use Last_Access_Time
, a sample script as below:
SELECT IdentityName,
StartTime,
Command,
IPAddress,
ExecutionTime
FROM tbl_Command WHERE CommandId IN
(SELECT Max(CommandId) FROM tbl_Command WHERE Application NOT LIKE 'Team Foundation JobAgent' Group By IdentityName ) ORDER BY Last_Access_Time DESC
Note, before you run the SQL script, you could double check if there are something changed, if there are some columns not available any more, since the blog is out of date.
Another way is archiving the contents of the tbl_command
in the TFS databases. In the TFS databases tbl_command
captures connection information. This table by default only stores 14 days of information. You could take a look at this similar question: Find out the users that has logged-in to TFS in last 6 months
You could setup another database and have a job to copy information for longer term use. Details please refer this sample.