{"id":4853,"date":"2012-06-11T06:13:00","date_gmt":"2012-06-11T06:13:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2012\/06\/11\/quick-response-sample-command-line-utility-to-manage-team-foundation-server-teams-and-users\/"},"modified":"2022-07-25T05:29:53","modified_gmt":"2022-07-25T13:29:53","slug":"quick-response-sample-command-line-utility-to-manage-team-foundation-server-teams-and-users","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/quick-response-sample-command-line-utility-to-manage-team-foundation-server-teams-and-users\/","title":{"rendered":"Quick Response Sample \u2013 Command line utility to manage Team Foundation Server Teams and Users"},"content":{"rendered":"<p><strong>Q<\/strong>uick <strong>R<\/strong>esponse samples provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group, in response to feature gaps to supplement the product and knowledge base information.<\/p>\n<p><img decoding=\"async\" width=\"173\" height=\"130\" title=\"PPP_PRD_215_3D_people-Business_Competition\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px\" alt=\"PPP_PRD_215_3D_people-Business_Competition\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/6283.PPP_PRD_215_3D_people-Business_Competition_thumb_04314345.png\" border=\"0\" \/><\/p>\n<h2>Issue<\/h2>\n<p>The <a href=\"http:\/\/vsarvmfactory.codeplex.com\/\">Visual Studio and Team Foundation Server VM Factory<\/a> automation team, working on the <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=244348\">Visual Studio Readiness \u201cGig\u201d<\/a> Hands-on Lab (HOL) prerequisite setup automation, required a command line utility, such as <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms252504(v=VS.80).aspx\">TFSSecurity<\/a>.exe , to add Teams and Team members to a Team Project. Investigations highlighted that in Visual Studio Team Foundation Server 2012 RC, a command line utility with the feature to manage teams and their members does not exist. A feature gap !<\/p>\n<h2>Resolution<\/h2>\n<p>Team Foundation Server has extensive support for Teams and Team membership management through the object model. You can build your own Teams administrative command line utility, using the ALM Rangers oob_<strong>TfsTeams<\/strong> sample solution, which you can download from <a href=\"http:\/\/vsarguidance.codeplex.com\/\">Supporting Guidance and Whitepapers<\/a>, in the\u00a0<a href=\"http:\/\/vsarguidance.codeplex.com\/releases\/view\/96222\">Quick Response<\/a> download package.<\/p>\n<h2>Sample<\/h2>\n<p>The sample is based on using the Team service which an extension on top of the <strong>Identity Management Servic<\/strong>e (IMS) in TFS. Refer to <a href=\"\/_willys\/ScratchPad\/RapidSamples\/Team%20Foundation%20Server%20Architecture\">Team Foundation Server Architecture<\/a> for more information on these services.<\/p>\n<p>To use the sample, proceed as follows:<\/p>\n<ul>\n<li>Rebuild the sample code using Visual Studio 2012 RC (or higher), whereby you require the TFS Object Model (OM).<\/li>\n<li>Run the TFSTeams.exe command line tool with the \/? parameter to get parameter help.<\/li>\n<li>Run the TFSTeams.exe command line tool to list or create teams, and to add members to teams.<\/li>\n<li>[Optionally] extend the sample code to implement other administrative features.<\/li>\n<\/ul>\n<p>Sample extract, TeamWrapper.cs:<\/p>\n<div id=\"codeSnippetWrapper\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 20px 0px 10px;width: 97.5%;font-family: 'Courier New', courier, monospace;direction: ltr;max-height: 200px;font-size: 8pt;overflow: auto;cursor: text;border: silver 1px solid;padding: 4px\">\n<div id=\"codeSnippet\" style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\">\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum1\" style=\"color: #606060\"> 1:<\/span> <span style=\"color: #008000\">\/\/ Copyright &copy; Microsoft Corporation. All Rights Reserved.<\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum2\" style=\"color: #606060\"> 2:<\/span> <span style=\"color: #008000\">\/\/ This code released under the terms of the <\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum3\" style=\"color: #606060\"> 3:<\/span> <span style=\"color: #008000\">\/\/ Microsoft Public License (MS-PL, http:\/\/opensource.org\/licenses\/ms-pl.html.)<\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum4\" style=\"color: #606060\"> 4:<\/span> <span style=\"color: #008000\">\/\/ This is sample code only, do not use in production environments<\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum5\" style=\"color: #606060\"> 5:<\/span> <span style=\"color: #0000ff\">namespace<\/span> Microsoft.ALMRangers.TfsTeams<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum6\" style=\"color: #606060\"> 6:<\/span> {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum7\" style=\"color: #606060\"> 7:<\/span>     <span style=\"color: #0000ff\">using<\/span> System;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum8\" style=\"color: #606060\"> 8:<\/span>     <span style=\"color: #0000ff\">using<\/span> System.Collections.Generic;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum9\" style=\"color: #606060\"> 9:<\/span>     <span style=\"color: #0000ff\">using<\/span> System.Linq;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum10\" style=\"color: #606060\"> 10:<\/span>     <span style=\"color: #0000ff\">using<\/span> Microsoft.TeamFoundation.Client;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum11\" style=\"color: #606060\"> 11:<\/span>     <span style=\"color: #0000ff\">using<\/span> Microsoft.TeamFoundation.Framework.Client;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum12\" style=\"color: #606060\"> 12:<\/span>     <span style=\"color: #0000ff\">using<\/span> Microsoft.TeamFoundation.Framework.Common;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum13\" style=\"color: #606060\"> 13:<\/span>     <span style=\"color: #0000ff\">using<\/span> Microsoft.TeamFoundation.Server;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum14\" style=\"color: #606060\"> 14:<\/span>     <span style=\"color: #0000ff\">using<\/span> System.Diagnostics;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum15\" style=\"color: #606060\"> 15:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum16\" style=\"color: #606060\"> 16:<\/span>     <span style=\"color: #0000ff\">internal<\/span> <span style=\"color: #0000ff\">class<\/span> TeamWrapper : IDisposable<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum17\" style=\"color: #606060\"> 17:<\/span>     {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum18\" style=\"color: #606060\"> 18:<\/span>         <span style=\"color: #0000ff\">private<\/span> <span style=\"color: #0000ff\">readonly<\/span> TfsTeamProjectCollection teamProjectCollection;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum19\" style=\"color: #606060\"> 19:<\/span>         <span style=\"color: #0000ff\">private<\/span> <span style=\"color: #0000ff\">readonly<\/span> TfsTeamService teamService;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum20\" style=\"color: #606060\"> 20:<\/span>         <span style=\"color: #0000ff\">private<\/span> <span style=\"color: #0000ff\">readonly<\/span> ProjectInfo projectInfo;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum21\" style=\"color: #606060\"> 21:<\/span>         <span style=\"color: #0000ff\">private<\/span> <span style=\"color: #0000ff\">readonly<\/span> IIdentityManagementService identityManagementService;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum22\" style=\"color: #606060\"> 22:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum23\" style=\"color: #606060\"> 23:<\/span>         <span style=\"color: #0000ff\">public<\/span> TeamWrapper(Uri collectionUri, <span style=\"color: #0000ff\">string<\/span> teamProjectName)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum24\" style=\"color: #606060\"> 24:<\/span>         {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum25\" style=\"color: #606060\"> 25:<\/span>             <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection = <span style=\"color: #0000ff\">new<\/span> TfsTeamProjectCollection(collectionUri);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum26\" style=\"color: #606060\"> 26:<\/span>             <span style=\"color: #0000ff\">this<\/span>.teamService = <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection.GetService&lt;TfsTeamService&gt;();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum27\" style=\"color: #606060\"> 27:<\/span>             <span style=\"color: #0000ff\">this<\/span>.identityManagementService = <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection.GetService&lt;IIdentityManagementService&gt;();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum28\" style=\"color: #606060\"> 28:<\/span>             ICommonStructureService4 cssService = <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection.GetService&lt;ICommonStructureService4&gt;();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum29\" style=\"color: #606060\"> 29:<\/span>             <span style=\"color: #0000ff\">this<\/span>.projectInfo = cssService.GetProjectFromName(teamProjectName);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum30\" style=\"color: #606060\"> 30:<\/span>             <span style=\"color: #008000\">\/\/Debug.WriteLine(this.identityManagementService.GetType().FullName);<\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum31\" style=\"color: #606060\"> 31:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum32\" style=\"color: #606060\"> 32:<\/span>             <span style=\"color: #008000\">\/\/ 20120612 - WPS: Authenticates the connection to Team Foundation Server if it has not been previously authenticated<\/span><\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum33\" style=\"color: #606060\"> 33:<\/span>             <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection.EnsureAuthenticated();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum34\" style=\"color: #606060\"> 34:<\/span>         }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum35\" style=\"color: #606060\"> 35:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum36\" style=\"color: #606060\"> 36:<\/span>         <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">void<\/span> Dispose()<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum37\" style=\"color: #606060\"> 37:<\/span>         {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum38\" style=\"color: #606060\"> 38:<\/span>             <span style=\"color: #0000ff\">this<\/span>.teamProjectCollection.Dispose();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum39\" style=\"color: #606060\"> 39:<\/span>         }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum40\" style=\"color: #606060\"> 40:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum41\" style=\"color: #606060\"> 41:<\/span>         <span style=\"color: #0000ff\">public<\/span> List&lt;<span style=\"color: #0000ff\">string<\/span>&gt; ListTeams()<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum42\" style=\"color: #606060\"> 42:<\/span>         {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum43\" style=\"color: #606060\"> 43:<\/span>             var teams = <span style=\"color: #0000ff\">this<\/span>.teamService.QueryTeams(<span style=\"color: #0000ff\">this<\/span>.projectInfo.Uri);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum44\" style=\"color: #606060\"> 44:<\/span>             <span style=\"color: #0000ff\">return<\/span> (from t <span style=\"color: #0000ff\">in<\/span> teams select t.Name).ToList();<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum45\" style=\"color: #606060\"> 45:<\/span>         }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum46\" style=\"color: #606060\"> 46:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum47\" style=\"color: #606060\"> 47:<\/span>         <span style=\"color: #0000ff\">public<\/span> Guid CreateTeam(<span style=\"color: #0000ff\">string<\/span> team, <span style=\"color: #0000ff\">string<\/span> description)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum48\" style=\"color: #606060\"> 48:<\/span>         {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum49\" style=\"color: #606060\"> 49:<\/span>             TeamFoundationTeam t = <span style=\"color: #0000ff\">this<\/span>.teamService.CreateTeam(<span style=\"color: #0000ff\">this<\/span>.projectInfo.Uri, team, description, <span style=\"color: #0000ff\">null<\/span>);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum50\" style=\"color: #606060\"> 50:<\/span>             <span style=\"color: #0000ff\">return<\/span> t.Identity.TeamFoundationId;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum51\" style=\"color: #606060\"> 51:<\/span>         }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum52\" style=\"color: #606060\"> 52:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum53\" style=\"color: #606060\"> 53:<\/span>         <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">bool<\/span> AddUser(<span style=\"color: #0000ff\">string<\/span> team, <span style=\"color: #0000ff\">string<\/span> user, <span style=\"color: #0000ff\">out<\/span> <span style=\"color: #0000ff\">string<\/span> message)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum54\" style=\"color: #606060\"> 54:<\/span>         {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum55\" style=\"color: #606060\"> 55:<\/span>             message = <span style=\"color: #0000ff\">string<\/span>.Empty;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum56\" style=\"color: #606060\"> 56:<\/span>             <span style=\"color: #0000ff\">bool<\/span> ret = <span style=\"color: #0000ff\">true<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum57\" style=\"color: #606060\"> 57:<\/span>             TeamFoundationTeam t = <span style=\"color: #0000ff\">this<\/span>.teamService.ReadTeam(<span style=\"color: #0000ff\">this<\/span>.projectInfo.Uri, team, <span style=\"color: #0000ff\">null<\/span>);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum58\" style=\"color: #606060\"> 58:<\/span>             TeamFoundationIdentity i = <span style=\"color: #0000ff\">this<\/span>.identityManagementService.ReadIdentity(IdentitySearchFactor.AccountName, user, MembershipQuery.Direct, ReadIdentityOptions.None);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum59\" style=\"color: #606060\"> 59:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum60\" style=\"color: #606060\"> 60:<\/span>             <span style=\"color: #0000ff\">if<\/span> (t == <span style=\"color: #0000ff\">null<\/span>)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum61\" style=\"color: #606060\"> 61:<\/span>             {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum62\" style=\"color: #606060\"> 62:<\/span>                 message = <span style=\"color: #006080\">\"Team [\"<\/span> + team + <span style=\"color: #006080\">\"] not found\"<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum63\" style=\"color: #606060\"> 63:<\/span>                 ret = <span style=\"color: #0000ff\">false<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum64\" style=\"color: #606060\"> 64:<\/span>             }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum65\" style=\"color: #606060\"> 65:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum66\" style=\"color: #606060\"> 66:<\/span>             <span style=\"color: #0000ff\">if<\/span> (i == <span style=\"color: #0000ff\">null<\/span>)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum67\" style=\"color: #606060\"> 67:<\/span>             {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum68\" style=\"color: #606060\"> 68:<\/span>                 message = <span style=\"color: #006080\">\"User [\"<\/span> + user + <span style=\"color: #006080\">\"] not found\"<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum69\" style=\"color: #606060\"> 69:<\/span>                 ret = <span style=\"color: #0000ff\">false<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum70\" style=\"color: #606060\"> 70:<\/span>             }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum71\" style=\"color: #606060\"> 71:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum72\" style=\"color: #606060\"> 72:<\/span>             <span style=\"color: #0000ff\">if<\/span> (ret)<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum73\" style=\"color: #606060\"> 73:<\/span>             {<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum74\" style=\"color: #606060\"> 74:<\/span>                 <span style=\"color: #0000ff\">this<\/span>.identityManagementService.AddMemberToApplicationGroup(t.Identity.Descriptor, i.Descriptor);<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum75\" style=\"color: #606060\"> 75:<\/span>                 message = <span style=\"color: #006080\">\"User added \"<\/span>;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum76\" style=\"color: #606060\"> 76:<\/span>             }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum77\" style=\"color: #606060\"> 77:<\/span>&nbsp; <\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum78\" style=\"color: #606060\"> 78:<\/span>             <span style=\"color: #0000ff\">return<\/span> ret;<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum79\" style=\"color: #606060\"> 79:<\/span>         }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: #f4f4f4;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum80\" style=\"color: #606060\"> 80:<\/span>     }<\/pre>\n<p>    <!--CRLF--><\/p>\n<pre style=\"text-align: left;line-height: 12pt;background-color: white;margin: 0em;width: 100%;font-family: 'Courier New', courier, monospace;direction: ltr;color: black;font-size: 8pt;overflow: visible;border-style: none;padding: 0px\"><span id=\"lnum81\" style=\"color: #606060\"> 81:<\/span> }<\/pre>\n<p>    <!--CRLF-->\n  <\/div>\n<\/div>\n<h2>Team<\/h2>\n<table style=\"width: 656px\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td width=\"200\" valign=\"top\">\n        ALM Ranger Contributor(s)\n      <\/td>\n<td width=\"454\" valign=\"top\">\n        <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2011\/03\/28\/introducing-the-visual-studio-alm-rangers-mattias-sk-246-ld.aspx\">Mattias Sk\u00f6ld<\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td width=\"200\" valign=\"top\">\n        ALM Ranger Reviewers\n      <\/td>\n<td width=\"454\" valign=\"top\">\n        <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2010\/09\/28\/introducing-the-visual-studio-alm-rangers-michael-fourie-also-known-as-mike.aspx\">Michael Fourie<\/a> | <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2010\/09\/02\/introducing-the-visual-studio-alm-rangers-rui-melo.aspx\">Rui Melo<\/a> | <a href=\"http:\/\/blogs.msdn.com\/b\/willy-peter_schaub\/archive\/2010\/10\/20\/introducing-the-visual-studio-alm-rangers-willy-peter-schaub.aspx\">Willy-Peter Schaub<\/a>\n      <\/td>\n<\/tr>\n<tr>\n<td width=\"200\" valign=\"top\">\n        Product Group Reviewer(s) \/ SME\n      <\/td>\n<td width=\"454\" valign=\"top\">\n        Ben Amodio | Gregg Boer | Hakan Eskici | Mario Rodriguez\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Future plans<\/h2>\n<ul>\n<li>Revise the sample code to include more administrative features<\/li>\n<li>Work with the ALM Rangers \/ ALM MVPs to build a command line tool for the community<\/li>\n<li>Add sample code to show the use of LiveIDs, for example when working with <a href=\"http:\/\/app.tfspreview.com\/\">TFS Preview<\/a><\/li>\n<\/ul>\n<h2>More ideas?<\/h2>\n<p><a href=\"http:\/\/visualstudio.uservoice.com\"><img decoding=\"async\" width=\"240\" height=\"52\" title=\"image2322\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px\" alt=\"image2322\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/5773.image2322_37D6E98C.png\" border=\"0\" \/><\/a><a href=\"https:\/\/visualstudio.uservoice.com\/forums\/133935-visual-studio-alm-rangers\"><img decoding=\"async\" width=\"240\" height=\"52\" title=\"image2222\" style=\"padding-left: 0px;padding-right: 0px;padding-top: 0px;border-width: 0px\" alt=\"image2222\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2012\/06\/6266.image2222_174FA9DA.png\" border=\"0\" \/><\/a><\/p>\n<p>Also please add your candid feedback and comments to this post!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quick Response samples provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group, in response to feature gaps to supplement the product and knowledge base information. Issue The Visual Studio and Team Foundation Server VM Factory automation team, working on the Visual Studio Readiness \u201cGig\u201d Hands-on Lab (HOL) prerequisite [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[228,253,229,1],"tags":[],"class_list":["post-4853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-admin-licensing","category-azure-devops-server","category-community","category-devops"],"acf":[],"blog_post_summary":"<p>Quick Response samples provide information directly from Visual Studio ALM Rangers working with the Microsoft Visual Studio Product Group, in response to feature gaps to supplement the product and knowledge base information. Issue The Visual Studio and Team Foundation Server VM Factory automation team, working on the Visual Studio Readiness \u201cGig\u201d Hands-on Lab (HOL) prerequisite [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=4853"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/4853\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=4853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=4853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=4853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}