We've got an odd issue where we need to find out when a file was checked out by a consultant. Is there any way to do this in TFS or VS2008?
Asked
Active
Viewed 5,893 times
7
-
1@Lieven I can't find any info in the properties on _when_ the file was checked out. – mflodin Jun 25 '12 at 12:30
-
@mflodin - Neither can I but I'm pretty sure I verified it before posting... god knows *what* I was looking at... – Lieven Keersmaekers Jun 25 '12 at 13:22
3 Answers
24
http://msdn.microsoft.com/en-us/library/9s5ae285%28v=vs.90%29.aspx
in short: TF.exe status /format:detailed /user:someone

Nock
- 6,561
- 1
- 28
- 27
-
1+1! Note that under VS2010 or VS2012, you might also have to specify the collection with /collection if you connect to more than one TFS instance. The link above points to VS2008 version of TF doc, which apparently doesn't have this option, but if you change the version to VS2010 or VS2010 you'll see it. Use "TF workspaces" to see the list of collections / workspaces. – Michael Bray Apr 30 '13 at 01:04
0
If you just want to know the check out time, you can use the email notification function in TFS. Which means, if someone check out a file, there will be an email send to you and tell you what is the check out time, operator, etc..

Robby Shaw
- 4,725
- 1
- 14
- 11
0
Download and Install TFS Power Tools. Then from your Source Control Explorer, you can right-click your code/solution folder, there should be a "Find In Source Control" option then "Status". Select that and you'll be able to query all checked out files or checked out files by a certain user.

Ann B. G.
- 304
- 2
- 6
-
But this won't show _when_ the files were checked out. Or is there a way to get a more detailed view using "Find in Source Control"? – mflodin Jun 25 '12 at 11:53
-
Hmmm, I don't think it does. I created this report a few months ago that gave me a list of all files checked out and when they were checked out, it highlighted those that have been checked out for more than two weeks and would email the user to review the files checked out. What I did was I had a stored procedure that executed TF.exe, saved it in a text file and I would just parse the text file and insert it into a DB table that would get updated every week. Here's a snippet of the first lines in the Stored Procedure (see next comment). From this you can figure out how to parse the text file. – Ann B. G. Jun 25 '12 at 14:11
-
`SELECT @fileName = 'E:\TFS\CheckoutReport\' + REPLACE(CONVERT(DATE,GETDATE(),101),'-','') + REPLACE(CONVERT(time,getdate()),':','') + '.txt' , @sqlCmd = 'C:\"Program Files (x86)"\"Microsoft Visual Studio 10.0"\Common7\IDE\tf.exe status $/* /user:*' + ' /s:http://
: – Ann B. G. Jun 25 '12 at 14:13/ /recursive /format:detailed > ' + @fileName , @openRowSql = 'SELECT * FROM OPENROWSET(BULK N''' + @fileName + ''', SINGLE_CLOB) as TFStxt'`