- How do you update all Work Item Type Definitions on a server?
-
Today there was a question on one of the lists I’m on, it went something like this:
Has anyone written a tool that will batch-update WITD to all team projects on a server? Surely this must be a common scenario?
One of the built-in Windows commands that I use daily is the “FOR” command. Here’s how simple it is to upload a new Bug.xml for a list of projects.
TFS2008
for %a in ("Project 1", "Project 2", "Project 3") do witimport /f Bug.xml /t http://tfsserver:8080 /p %a
TFS2010
for %a in ("Project 1", "Project 2", "Project 3") do witadmin importwid /s http://tfsserver:8080/tfs/CollectionName /p %a /f Bug.xml
If you wanted to get fancy, you could even create a teamprojects.txt file with a team project name per line, and use the /F parameter to read them from a file. There are a few subtleties with that though, make sure you quote any parameters that need quoting:
for /F %a in (teamprojects.txt) do witimport /f Bug.xml /t http://tfsserver:8080 /p “%a”
And the last example for today is if you want to run the same command on every file in a directory. I use this all the time with relog.exe, when I want to concatenate a directory of perfmon logfiles (one for each hour) and change them to a different format. For example:
for /R %a in (*.blg) do relog %a –f CSV –o output.csv –a
Also remember, if you want to use the “FOR” command from within a batch file, you need to use %%a instead of just %a.
Update:
- Permissions required for Team Build Retention Policy in TFS2008
-
I got a question from one of our internal email lists today:
Our TFS build service is owned by a generic build account – domain\tfsbuild. We have retention policy set up to retain a fixed set of builds. The old builds were deleted when viewed via Team Explorer. However, on the drop server, the builds are not deleted. Apparently there’s an access issue when TFS attempted to delete the old builds.
Someone told me that the TFS service account will need admin rights. Is this true?
Aaron from the Team Build team did a good job of explaining what was happening:
When TFS deletes build drops it first tries to have the build agent do the deletion, and then falls back to the AT. Ideally, then, both the build service account and the AT service account would have full control to the root of the drop location. This does not mean that these accounts need to be administrators on the box, however – that should not be a requirement.
There should be errors in the event log on the AT whenever TFS tries to fully delete a drop – these should include the error that caused the deletion to fail. You might have to get your friendly TFS administrator to have a look on the server and see if they find any such errors for the builds whose drops didn’t get deleted.
Another is that the drop locations were in use when they got deleted – this is fairly common, typically resulting in everything on the drop but the handful of files that were in use getting deleted, along with whatever folder structure got preserved as a result. You might have a look at your undeleted drops to see if everything is there, or just a few files.
- TFS Performance Report Pack now works with SSRS2005
-
Back in February, I released some of the reports that were created for our internal TFS servers on my blog as the TFS Performance Report Pack. I got countless emails and comments on the fact that some of them didn’t work with SQL Reporting Services 2005.
Fortunately, Jim Saunders from the Developer Support team at Microsoft (who have a great blog!) has re-created the three reports in the pack that required SQL2008 Reporting Services. Just download a different version of the reports from here and replace the ones in the original zip file.
From the support team blog:
...He lists SQL Server 2008 Reporting Services as a requirement, with a note that they should work in SSRS 2005. It turns out some of the reports function under both SSRS 2008 and 2005, some do not. Several posters have mentioned incompatibilities with some reports and SSRS 2005.
These reports are compatible with either SSRS version:
- Server Status - Historical Performance Trends.rdl
- Server Status - Recent Performance Trends.rdl
- Server Status - Top Users Bypassing Proxies.rdl
These reports require SSRS 2008:
- Execution Time Summary.rdl
- Execution Time for User.rdl
- Server Status - Source Control Request Queue.rdl
I have created versions of the three reports above that are functionally similar to Grant's reports, but also work with SSRS 2005. You can download my updated reports here. To use my reports, install Grant's TFS Performance Report Pack, and replace the three reports with the versions in the zip file I provided.
- 1 Year at Microsoft
-
Last week was my first anniversary of accepting a job with Microsoft and relocating 8000 miles across the Pacific to Seattle, Washington. It’s been an amazing year filled with so many new experiences and challenges. The role I took (Program Manager) was a perfect fit for me and I’m not planning on going anywhere soon. I’m the first to admit that it’s been a challenging year dealing with constant dogfood server issues and other randomness. But, with lots of hard work and persistence I know we’re in a much better position than where we were this time last year. The product (and other Microsoft products) are certainly much better because of our efforts and most of that is reflected in the TFS2010 Beta1 release. Now we’ve just got to wrap it all up and get it out the door.
As you probably know from some of my blog posts, one of my main focuses has been performance. I now have a much better idea of the different aspects of server performance. I’ve learnt more than I probably wanted to know about the internals of TFS, SQL, Windows and how SAN’s work – but it’s been a great journey.
Outside of work, I’ve come to love the uniqueness of the Pacific Northwest and all it has to offer (mountains, lakes, sunshine, snow & rain). For the past 6 months I’ve been doing an intensive Basic Alpine Climbing Course run by The Mountaineers with three other VSTS Softies. This has included lots of evening training sessions, equipment purchases, night climbs, weekend field trips and evaluations. April was by far the busiest month, with an activity on 15 of the 30 days in April! The good news is that all the evaluations and practices are over and it’s time to Climb On in the summer climbing season.
My wife and I have also settled in to our new apartment in Kirkland’s Juanita neighborhood. It’s a great area with lake views, a beach, plenty of restaurants and close enough to the highways to make it easy to get to. After moving house 4 times in the last 12 months, it finally feels like we’re settled. Since we’re pretty close to the Microsoft campus and the weather has been so great lately, I’ve also started riding my bike to work. You can check out my commute along with the elevation profile on MayMyRide.com.
Last of all, thanks to everybody who has helped me settle in to life in the US and at Microsoft – it’s not even half as bad as I had thought it might be.
- TFS Adoption at Microsoft – May 2009
-
As promised last week in my Dogfooding TFS show on the RadioTFS podcast, here is the latest on TFS within Microsoft that myself and Brian have posted about in the past.
May had the all-time peak in the total number of unique active users with 15,613. In addition, the total number of source code files stored surpassed 60 million. The total number of projects continues to increase and will end the fiscal year over 3,500, growing by over 1,300 in the last year. MSIT RXD continues to lead the way using a TFS2010 pre-beta1 build with an average of 100 active users per week.
Summary of growth indicators for the month:
| May 2009 | Growth | Totals |
| Unique Active Users | +29 | 15,613 |
| Total Active Users | +24 | 17,680 |
| Projects | +98 | 3,434 |
| Work Items | +170,436 | 3,934,238 |
| Source Code Files | +1,760,516 | 60,253,062 |
We call the internal TFS at Microsoft the “TFS Service Offering”. All the servers are setup and maintained by our partners in Microsoft IT.
Active Users - Service Offering:

Projects & Unique Active Users Across Service Offering:
The number of team projects was up by 98 this month. Added to the chart this month are labels for the releases since January 2007 to give some perspective on growth and when versions were released.


Team Builds:
Combined data from across the Service Offering.

- RadioTFS Podcast on Dogfooding TFS
-
Last week I sat down (virtually) with two of our Team System MVP’s - Martin Woodward and Paul Hacker. We had a good chat about TFS at Microsoft which you can listen to on show #22 of the RadioTFS podcast.
In the show we talked about a range of topics. Here are some links:
- Large Team Foundation Server Performance Characteristics
-
Since joining Microsoft, I’ve become intimately familiar with running a TFS server for ~3,500 users in Developer Division and the performance characteristics of it.
One thing I’ve learnt is that Performance Counters rule. You might observe the server being “slow” and you might notice that it “takes a while” to do certain operations – but you need evidence to back up your claims before anybody will take you seriously. The evidence that everybody has access to, is reliable and people take seriously are the perf counters built into windows.
See my previous posts on Relogging Perfmon binary log files to SQL and Querying Perfmon data from SQL for more details on setting up performance counter logs.
If I think about the problems we’ve overcome in the last 12 months, the issues come down to these:
- IO – If the “LogicalDisk\Avg. Disk sec/Transfer” perf counter for any of your disk drives is more than 0.030 (30ms) – then you’re hosed. This counter is a primary indicator of disk latency. Get that fixed before doing anything. (see below for more details)
- Workspace Mappings – If you have unnecessary paths in your workspace mappings, then Get() will be much slower than it needs to be. E.g. DON’T map $/ to C:\Code and think that everything will be good. A root mapping isn’t truly a bad thing but if you aren’t careful it can lead to unexpected and potentially slower results.
- Latency/Download requests – Proxy servers help here by offloading Download() requests from the main server. Doesn’t help Work Item tracking.
- CPU – Processor performance isn’t linear. If you’re running higher than ~70% CPU for periods of time, then you need to increase your processing capacity.
- SQL indexes/fragmentation – Sometimes the TFS SQL Jobs that update statistics & rebuild/reorganize indexes stop running, or don’t run for whatever reason. Check that the SQL jobs are running successfully and check for index fragmentation.
The tools you can use to diagnose performance issues are:
- PerfMon. Setup a perfmon counter log for the important counters. Track them and work out what’s “normal” for your load/environment
- TfsActivityLogging database. Dive into this database and look for trends, heavy users, heavy tools, etc. Understand where your load is coming from.
- TfsServerManager.exe (Comes with the Team Foundation Server Power Tools, see Brian’s blog for more details)
- No shortcut gets created. Run it from "C:\Program Files\Microsoft Team Foundation Server 2008 Power Tools\TfsServerManager.exe"
- If users are reporting a problem, try and catch it while it’s currently executing. Look at the “Source Control Request Queue” report. Is their request on top?
- Run the following query a few times in SQL to see if any blocking is occurring. If the same spid hangs around for a while, run DBCC INPUTBUFFER(spid_here) to see what stored procedure it is and try and match that to a TFS command. e.g. prc_Get = Get()
SELECT a.status, a.*
FROM sys.sysprocesses a
WHERE spid > 50
and spid <> @@spid
and blocked = 0
and EXISTS ( SELECT *
FROM sys.sysprocesses b
WHERE b.blocked = a.spid)
Disk Latency
To determine if you are having significant issue with disk latency you should use the following performance counters:
- Object: [Physical Disk] or [Logical Disk]
- Counter: [Avg. Disk Sec/Transfer]
- Instance: Ideally you collect this for individual disks however you may also use [_Total] to identify general issues. If [_Total] is high then further collections can be taken to isolate the specific disks affected.
- Collection Interval: Ideally you should collect at least every 1 minutes. The collection should be run for a significant period of time to show it is an ongoing issue and not just a transient spike. 15 minutes is minimum suggested interval.
- Issue Thresholds (seconds):
- < 0.020: Normal time and no I/O latency issues are apparent
- > 0.00 – 0.050: You may somewhat concerned. Continue to collect and analyze data. Try to correlate application performance issues to these spikes
- > 0.050 – 0.100: You are concerned and should escalate to SAN administrators with your data and analysis. Correlate spikes to application performance concerns.
- > 0.100: You are very concerned and should escalate to SAN administrators. Correlate spikes to application performance concerns.
Further Reading
If you want to understand more about Windows server fundamentals, take a look at the Microsoft Windows Server 2003 Performance Guide. It was published in 2005, but it is a valuable resource on PerfMon, Relog, Performance troubleshooting and performance monitoring. Most of the counters and tools are still valid for Windows 2008 and beyond.
You can read it online or buy the print version from your favorite online book store.
- Visual Studio Team System 2010 Team Foundation Server Beta 1 Installation Problems
-
First of all, see my last post Visual Studio Team System 2010 Beta 1 Download Links for all the download links and installation docs. Also check out Brian Keller’s post on Using a download manager to quickly download Visual Studio 2010 Beta 1.
We greatly value your feedback. Please fill in the Visual Studio 2010 and .NET Framework 4 Beta 1 Survey and visit the Microsoft Connect Beta 1 Feedback page to submit a bug or a suggestion.
Also, the Microsoft Visual Studio Team Foundation Server 2010 Beta1 Forums are being tracked by the product team so that you can get help with your installation issues and share feedback.
If you don’t like forums, or you’d like to discuss TFS2010 with other people over email, you can also join the OzTFS.com mailing list for the latest buss.
The Readme File
In this post, I want to bring your attention to the Team Foundation Server Beta 1 Readme and the common gotchas I’ve seen people hit when installing TFS2010 Beta1.
These are the issues I’ve hit myself (because I didn’t read the readme…)
TF31001 "The ServicePointManager does not support proxies with the https scheme."
If you are trying to connect to a TFS server that is configured using HTTPS, then you might run into this issue.
See Aaron Block’s blog post for all the details.
On all machines:
reg add hklm\SOFTWARE\Microsoft\VisualStudio\10.0\TeamFoundation\RequestSettings /v BypassProxyOnLocal /t REG_SZ /d False
reg add hklm\SOFTWARE\Microsoft\TeamFoundationServer\10.0\RequestSettings /v BypassProxyOnLocal /t REG_SZ /d False
Additionally on a 64-bit machine:
reg add hklm\SOFTWARE\Wow6432Node\Microsoft\TeamFoundationServer\10.0\RequestSettings /v BypassProxyOnLocal /t REG_SZ /d False
reg add hklm\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\TeamFoundation\RequestSettings /v BypassProxyOnLocal /t REG_SZ /d False
Initial Configuration of Team Foundation Server Should be Run From MSI Program or by Command Line
Initial Team Foundation Server configuration fails on Windows SharePoint configuration if you access the Team Foundation Configuration Tool by clicking the link in the Team Foundation Administration Console instead of by launching Team Foundation Configuration Tool at the end of the installation phase.
To resolve this issue:
If you want to setup Windows SharePoint Server during Team Foundation Server configuration, you must launch the Team Foundation Server Configuration Tool by using one of the two following methods:
- Launch the Team Foundation Configuration Tool by selecting the check box at the end of the Team Foundation Server installation
- If you exited Team Foundation Server MSI program (setup.exe) without launching Team Foundation Configuration Tool, do not start the Administration Console from the Start menu item shortcut. Instead use following command line:
%programfiles%\Microsoft team foundation server 10.0\tools\tfsmgmt.exe configure
After Team Foundation Server has installed and configured Windows SharePoint, you can configure Team Foundation Server by using the Start menu to launch Team Foundation Server Administration Console.
If you don’t do this, then your SharePoint configuration will be broken and you’ll get a 404 on the SharePoint Administration site.
Team Foundation Server Name May Not Be Over 14 Characters
The name of the server running Team Foundation Server may not be over 14 characters.
To resolve this issue:
Use a valid NETBIOS name of 14 Characters or less for Team Foundation Server. Configuration fails if the name of the server running Team Foundation Server uses more than 14 characters.
TF50363: The following display name is not valid
This is due to a known bug in our upgrade scripts where in the Version Control db (TfsVersionControl) tbl_Identity table there exists one or more rows where the DisplayName field contains data that is not in the expected format of domain\username.
If you hit this error, the workaround is to update the row and prefix the existing value with a dummy domain name like 'domain\'.
See Bryan Krieger’s blog post TFS 2010 Beta1 - Upgrade may fail with TF50363: The following display name is not valid.
Windows Server 2008 R2 RC & SQL Express
Although Windows Server 2008 R2 RC is not officially supported by this build, it is possible to get TFS running using a couple of workarounds. See Installing TFS 2010 on Windows Server 2008 R2 RC from the TFS Developer Support team.
I’ve also heard talking that that install will work OK with an odd error message, but SQL Express won’t run. Not sure on the details of this one. YMMV. It might need SQL Server 2008 SP1.
Visual Studio 2008 Compatibility with a Team Foundation Server 2010 server
We are planning a Forward Compat GDR for the VSTS 2008 SP1 client. This set of features will allow the VSTS 2008 client users to have a good experience when connected to a TFS 2010 team project, but will not provide full 2010 functionality.
Things that you should know:
- Most admin functionality can only be performed from a new client.
- For example, we block PCW from the 2008 client to the 2010 server.
- We require the admin to have a 2010 client.
- In Work Item Tracking, we added hierarchy and other link types which the older client does not support. The user experience is being improved with the GDR so the 2008 client user can distinguish which queries are supported and which do you need the 2010 client for.
- Work Item Tracking, also has a new location for Reports with the addition of the Team Project Collection structure. The GDR will allow the 2008 client to navigate to the new report location.
- Shared Documents, Process Guidance and the Project Portal locations can be configured so again we need the GDR to assist with the new navigation.
- Test Case Management is also being enabled in the 2008 client using the GDR.
- Version Control is improving the rename scenarios in the GDR.
- There are a bunch of error messages which will be more helpful as well.
Readme Topics
I know that people don’t read the Readme files (I’m guilty too) – so here are the headings from the Readme in the hope that you’ll at least browse these for potential issues first :)
- Installing
- Upgrade Breaks Links on the SharePoint Products and Technology Portal
- Some Visual Studio Team System 2010 Features Not Available After Upgrade
- Initial Configuration of Team Foundation Server Should be Run From MSI Program or by Command Line
- Uninstalling
- Need to uninstall TFS Object Model before uninstalling VSTS if installed from the web
- Product Issues
- Managing Users on Upgraded Team Projects Might Result in Error TF50620
- Cannot Install Team Foundation Build Service on Windows XP
- Require SSL Option Not Supported
- No Work Item Only View feature in Team System Web Access
- You Can Only Associate a Single URL with a Team Project in Team Explorer
- Team Foundation Server Service Account must be different then the account used for installing Team Foundation Server
- Uninstall Team Explorer Does Not Remove Visual Studio Shell
- Installing Team Foundation Server on a Windows Domain Requires a Live Connection to the Domain Controller
- Team Foundation Server Name May Not Be Over 14 Characters
- Do Not Launch Teamfoundation.msc Directly or Add to Microsoft Management Console (MMC)
- Changes to Lab Management Network Location Tab Requires an IIS Reset
- Converters
- VSSConverter.exe Not Supported
- Office Integration
- Office Integration Requires Manual Installation of Office Primary Interop Assemblies (PIA) on Windows XP
- Visual Studio Team System 2010 Installation Program Appears After You Launch Microsoft Project
- Process Templates and Team Project Portal
- No Process Guidance Updates
- Capability Maturity Model Integration (CMMI) 5.0 Process Template Incomplete
- Remote Portal Running as Network Service Can Cause Broken Dashboards
- Reporting
- Team Foundation Server Stops Collecting Reporting Data from the Team Project Collection
- Team Foundation Server Reports Are Out-of-date After Install/Upgrade
- Team Foundation Server Data Warehouse Custom Adapters Do Not Work
- Test Integration
- No Test Steps, Repro Steps or Associated Automation Controls in Team System Web Access
- Compatibiltiy
- Team Explorer 2008 or older client users can create new build definitions but they will not be able to edit them or to edit other, existing build definitions.
- Team Explorer 2008 or older clients will be able to submit changes that affect gated build definitions, but they will not be prompted with the confirmation dialog and, if their check-in affects multiple gated definitions, it will fail.
- Team Explorer 2008 or older clients will not be able to manage build resources using the “Manage Build Agents” dialog box.
- Microsoft Project plan documents created using a Team Explorer 2010 client, break when opened from a Team Explorer 2008 or older client.
- Navigation to non-default Shared Document, Project Portal and Process Guidance locations is broken for a Team Explorer 2008 SP1 or older clients.
- Navigation to new Reports is not supported for a Team Explorer 2008 SP1 or older clients.
- Work Item Tracking Queries with new functionality are not supported for a Team Explorer 2008 SP1 or older clients.
- Rename in Version Control is not supported for Team Explorer 2008 SP1 or older clients.
- Test Results Publishing is not supported for a Team Explorer 2008 SP1 or older clients.
- How to connect to Team Explorer 2010 to Team Foundation Server 2008
- How to connect a Team Explorer 2008 SP1 to a Team Foundation Server 2010 Server
- Team Foundation Server 2010 administrative functions are only supported using Team Explorer 2010.
- Visual Studio Team System 2010 Beta 1 Download Links
-
The Visual Studio Team System 2010 Beta 1 bits have been available to MSDN subscribers since Monday. Now the bits are available to everybody on microsoft.com/downloads.
If you want to use a download manager and need the direct URLs, take a look at this page:
If you are installing Team Foundation Server 2010 Beta 1, then don’t forget to read the following docs:
Also checkout Brian & Chuck’s 10-4 Episode 20: Downloading and Installing Visual Studio 2010 Beta 1
Then once you’ve got everything installed and you’ve started using it – send us your feedback and get answers to your questions using these sites:
- Replying inline in Outlook with [Name]:
-
Did you know that there’s a feature in Outlook that prefixes your name automatically when you reply inline like this?
When you reply to somebody and start replying inline, it automatically changes the font to a new color and prefixes it with [GrantH] or similar.
Open Outlook | Tools | Options | Mail Format | Signatures & Stationary..

- Announcing TFS Performance Report Pack
-
Update 6/23/2009: Due to popular demand, Jim from the Developer Support team at Microsoft has re-created the three reports that required SQL2008 Reporting Services. See the support team blog for more details.
I’m on the team that runs the busiest Team Foundation Server at Microsoft. The Developer Division instance has over 3,500 active users and processes over 10,000,000 source control and work item tracking requests per day (not including the requests that our 5 proxy servers handle).
We have a responsibility to ensure that the server is performing as expected and to identify any efficiencies that can be made in the server or the tools. To do this, we have created a number of reports that we use ourselves and make available to our own users.
Download
We’re now making these reports available to you to install on your own server and monitor your TFS server’s performance. The plan is to eventually roll these into a power tool release or a subsequent release of VSTS but I’ll let you know more about that when it happens.
Requirements
- SQL Server Reporting Services
- A user with read-only access to the TfsActivityLogging database
- A shared datasource to connect the report to (see below)
- Command Logging enabled - This logging is enabled by default in TFS 2008.
Installing
The report pack consists of a ZIP file with a number of Report Definition (*.rdl) files. These files are designed to be deployed onto your existing TFS reporting server, e.g. http://your-tfsserver/Reports/
- As a TFS administrator, extract the files to your PC
- Open http://your-tfsserver/Reports/
- Create a new folder in Reporting Services called “Server Status”
- Create a new shared data source called “TfsActivityReportDS” and set the connection string to:
- Data Source=localhost;Initial Catalog=TfsActivityLogging
- Credentials: domain\user that has access to the TfsActivityLogging database
- Use as windows credentials when connecting to the data source
Here’s an overview of what the reports look like and what questions you can answer with them.
Execution Time Summary
This report visualizes the load, in this case reflected by total execution time, on the server from two axis: users and commands.
Use this report when you want to know:
- Which commands account for the largest load on the server?
- Which tools / or users are putting the biggest load on the server?
Server Status - Source Control Request Queue
Source Control is undoubtedly the application that consumes the most resources on an Application Lifecycle Management (ALM) Server. Across the day, a series of requests get queued to be processed as transactions are committed to the database. This report provides a view into that queue.
Use this report when you want to know:
- If a request is blocking source control operations and for how long
- How healthy is the performance of version control on this hardware?
Lots of red means that you have some long running operations and you may have some problems.
Server Status - Top Users Bypassing Proxies
In the past, I’ve blogged a query to get this information – How many user’s are not using a TFS Proxy server? Internally, we have setup a scheduled subscription that emails this report twice a week.
IT departments strive to provide the best level of service to their users. Hardware requirements planning and setting up proxies are activities that ensure optimal performance for their internal teams when interacting with team Foundation Server. This report allows administrators a view into which users are not complying with internal guidelines and hence decreasing overall server performance.
Server Status - Historical Performance Trends
This report serves as a summary of the average response time for two of the Team Foundation Server subsystems: Work Item Tracking and Version Control
Use this report when you want to know:
- How long are users, on average, waiting for a subsystem to process their request
- Which days of the week are the most critical when it comes to performance
Server Status - Recent Performance Trends
This report provides more data granularity about the performance of the server. We start with a view into the server average response time, now looking at the entire picture instead of broken down by subsystem. We then follow with charts relating information about version control downloads and average response time distributions for the same time period.
Use this report when you want to know:
- The correlation between degraded server performance and average response times by the subsystems
- How does a large number of downloads affect overall server performance
- Overall health indicator of the server
![clip_image002[4] clip_image002[4]](http://blogs.msdn.com/blogfiles/granth/WindowsLiveWriter/AnnouncingTFSPerformanceReportPack_AFF5/clip_image002%5B4%5D_thumb.jpg)
I hope that you find these reports useful. Please send any questions or feedback as comments to this post, or contact me via email.
- Analyzing TFS performance with TfsActivityLogging and custom User Agents
-
Within Developer Division at Microsoft, we run a very busy server. We’re up to almost ~3,600 active users.
Just over 6 months ago, the custom tools that our build labs were using were putting an extraordinary strain on the server. More than 40% of the load on the server was just from these tools. After some fairly deep analysis into what the tools were doing and how they were using TFS, we identified some inefficiencies and were able to address them in the tools.
The two most useful resources for tracking down these issues and addressing them were:
- TfsActivityLogging database
- Setting a custom User Agent string
These are examples of the reports that we came up with to track our progress at making the efficiencies. They show total execution time from the TfsActivityLogging database split up by user and by command. You can also select a particular user and drill down and see just their commands. This showed us where our efforts were best spent.
Then the report also shows the details with actual Execution Time, Execution Count and Average Response Time (Time divided by Count) for each command.

Here’s a sample SQL query you can use to start looking at this data yourself:
SELECT
Application,
Command,
SUM(ExecutionTime/1000) as TotalTime_ms,
SUM(ExecutionCount)
FROM TfsActivityLogging.dbo.tbl_Command with (nolock)
GROUP BY Application, Command
Now I know that as soon as I post this, I’m going to get flooded with comments/emails asking “Can you send me the report file?”. Don’t worry, I’m working with Mario and we should be able to get some goodness posted up on Codeplex.
Setting a custom user agent for the TFS Object Model
Once we had identified which users were contributing the most load, we needed to map their scripts and tools to TFS commands.
One of the columns within the TfsActivityLogging database that gets logged with every request to TFS is the “UserAgent” column. It turns out that you can set this to an arbitrary value using the TeamFoundationServer.ApplicationName property in the TFS object model.
using System;
using System.Text;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://tfs-server:8080", new UICredentialsProvider());
TeamFoundationServer.ApplicationName = "MyApplication v1.1 - Phase1";
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
Changeset cs = vcs.GetChangeset(1);
}
}
}
By setting this value dynamically throughout the custom scripts, we were able to map stages in the build process to groups of actual TFS commands. Then we were able to refactor the build scripts and optimize them for better TFS performance.
- TFS Adoption at Microsoft – November 2008
-
Every month our internal teams put together statistics on the TFS servers deployed at Microsoft. Previous statistics can be found here:
One of the noteworthy milestones this month is total Work Items stored has now surpassed the 3,000,000 mark. We’re also approaching 50 million Source Files stored.
Here’s the summary of growth indicators for the month:
| November 2008 | Growth | Totals |
| Unique Active Users | +170 | 15,308 |
| Total Active Users | +377 | 17,388 |
| Projects | +125 | 2,749 |
| Work Items | +167,598 | 3,050,512 |
| Source Code Files | +2,441,418 | 47,418,877 |
| Total Builds | +60,121 | 584,380 |
The Service Offering consists of 27 instances, 24 running on TFS 2008 SP1 and 3 running very early Rosario bits.

The total number of active unique users has grown 9% since July. Also, as a reminder, In July 2008, the number of active users was adjusted to report on unique users only, eliminating duplicates across instances:
![clip_image002[4] clip_image002[4]](http://blogs.msdn.com/blogfiles/granth/WindowsLiveWriter/TFSAdoptionatMicrosoftNovember2008_F81C/clip_image002%5B4%5D_1.gif)
- My Top 25 search keywords
-
I’ve been looking at my blog stats for the last couple of months to see what people find valuable on my blog and where my traffic comes from.
Traffic Sources
Search Keywords
It’s clear from my top 25 search keywords that my posts on the VS2010 CTP and tf.exe Unable to determine the workspace are quite useful.
- vs2010
- tf30076
- vs2010 ctp
- unable to determine the workspace
- tf84034
- grant holliday
- tf30330
- microsoft tfs
- tfs training
- team foundation server review
- tf.exe unable to determine the workspace
- tfs 64 bit
- relog sql
- team foundation server 2008 books
- team foundation server books
- "unable to determine the workspace"
- unable to determine the workspace.
- team foundation server 2008 in action
- tfs proxy
- tfpt unable to determine the workspace
- tf get unable to determine workspace
- tfs scripting
- team foundation proxy server
- install team build
- a previous installation of hyper-v integration services has been
My personal goal was to get to a point where I can type “granth <keywords>” into a search engine and it will bring up a blog post that I’ve written. That has worked well :) For example:
- Visual Studio 2010 CTP VPC will expire Jan 1 2009
-
If you are running the Visual Studio 2010 and .NET Framework 4.0 CTP under Virtual PC or Hyper-V, you should know that the copy of Visual Studio installed in the VPC is set to expire.
After January 1, 2009, you will no longer be able to launch the Visual Studio in the VS2010 CTP. This is due to a hard-coded expiration date in this CTP. CTP's are pre-release software, so they aren't designed to run forever.
If you haven’t disabled time synchronization before Jan 1 and you start Visual Studio – you will need to re-download the image and disable time synchronization before starting fresh.
Workaround for Virtual PC Users
See Brian Keller’s post on Dealing with Activation Messages for the full details. But essentially it boils down disabling time synchronization under Virtual PC 2007 before the timebomb is hit.
Workaround for Hyper-V Users
If you converted the VPC to run under Windows 2008 Hyper-V using my previous instructions, disabling time synchronization is different. See Cameron Skinner’s post on disabling time synchronization in Hyper-V for the full details. You need to take a snapshot of the VM, shut it down and go into Settings >> Integration Services >> Time Synchronization and disabled it.