Where are logs for witadmin actions in TFS 2010?

2019-04-11 21:20发布

问题:

When running the witadmin command from the Visual Studio 2010 Command Line, where is this action logged in TFS 2010? An example command would be:

C:>witadmin exportwitd -collection:http://server:8080/tfs/projectcollection -p:TeamProject -n:Bug -f:c:\Bug.xml

回答1:

One way to do this would be to query the command log in the collection database. Note: it's generally recommended not to query the database directly, since the schema is not documented/supported and could change in a future release.

select * from tbl_Command with (nolock) where useragent LIKE 'Team Foundation (witadmin.exe%'

A 'exportwitd' command will show up as Command = 'GetMetadata'. But that is also the same command that Visual Studio makes when you connect to TFS, so you'll need to filter on the user agent.

A 'importwitd' command will show up as Command = 'Update'