using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; var pendingList = new List<KeyValuePair<string, string>>(); foreach (var ser in RegisteredTfsConnections.GetProjectCollections()) { var server = RegisteredTfsConnections.GetProjectCollection(new Uri(ser.Uri.ToString())); var projects = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(server); var versionControl = (VersionControlServer)projects.GetService(typeof(VersionControlServer)); var userName = versionControl.AuthorizedUser; var workspaces = versionControl.QueryWorkspaces(null, userName, System.Net.Dns.GetHostName()); foreach (var workspace in workspaces) { var pendingChanges = workspace.GetPendingChanges(); foreach (PendingChange pendingChange in pendingChanges) { var pendingItem = new KeyValuePair<string, string>(server.Name, pendingChange.LocalItem); pendingList.Add(pendingItem); Console.WriteLine("{0}\t{1}", pendingItem.Key, pendingItem.Value); } } } Console.In.ReadLine();