Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In TFS2012, the <code>IGroupSecurityService</code> was marked obsolete and replaced with <code>IIdentityManagementService</code>.</p> <p>You can use <a href="http://msdn.microsoft.com/en-us/library/ff731745.aspx" rel="noreferrer"><code>IIdentityManagementService.ReadIdentity()</code></a> along with <a href="http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.framework.client.iidentitymanagementservice.addmembertoapplicationgroup.aspx" rel="noreferrer"><code>IIdentityManagementService.AddMemberToApplicationGroup()</code></a> to add Windows users to TFS groups, even if those Windows users are not known to TFS yet.</p> <p>This is accomplished by specifying the <a href="http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.framework.common.readidentityoptions.aspx" rel="noreferrer"><code>ReadIdentityOptions.IncludeReadFromSource</code></a> option.</p> <p>Below is an example of adding a Windows user <code>VSALM\Barry</code> to the <code>Fabrikam Fiber Web Team</code> (TFS Group), in the <code>FabrikamFiber</code> Team Project, in the <code>http://vsalm:8080/tfs/FabrikamFiberCollection</code> server/collection.</p> <p>You will need to add references to: <code>Microsoft.TeamFoundation.Client</code> and <code>Microsoft.TeamFoundation.Common</code></p> <pre><code>using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.Framework.Client; using Microsoft.TeamFoundation.Framework.Common; using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://vsalm:8080/tfs/FabrikamFiberCollection")); var ims = tpc.GetService&lt;IIdentityManagementService&gt;(); var tfsGroupIdentity = ims.ReadIdentity(IdentitySearchFactor.AccountName, "[FabrikamFiber]\\Fabrikam Fiber Web Team", MembershipQuery.None, ReadIdentityOptions.IncludeReadFromSource); var userIdentity = ims.ReadIdentity(IdentitySearchFactor.AccountName, "VSALM\\Barry", MembershipQuery.None, ReadIdentityOptions.IncludeReadFromSource); ims.AddMemberToApplicationGroup(tfsGroupIdentity.Descriptor, userIdentity.Descriptor); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload