Language: C#
Query for Build Controllers and Agents
using Microsoft.TeamFoundation.Build.Client; // enumerate the build controllers and agents for the specified project collection var tfs = TeamFoundationServerFactory.GetServer("http://tfserver:8080/tfs/DefaultCollection"); IBuildServer buildServer = (IBuildServer)tfs.GetService(typeof(IBuildServer)); var buildControllers = (IEnumerable<IBuildController>)buildServer.QueryBuildControllers(true); foreach (IBuildController controller in buildControllers) { Debug.WriteLine("{0} ({1})", controller.Name, controller.ServiceHost.Name); foreach (IBuildAgent agent in controller.Agents) { Debug.WriteLine("\t{0} ({1})", agent.Name, agent.ServiceHost.Name); } }
Tags:
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

