【问题标题】:Add groups and users from Active directory to TFS programatically以编程方式将组和用户从 Active Directory 添加到 TFS
【发布时间】:2019-04-27 16:17:48
【问题描述】:

我们可以以编程方式将用户和组添加到 TFS,并使用团队项目的管理上下文在 TFS 中添加 AD 用户/组。但是我可以通过编程将包含 Active Directory 用户的组添加到 TFS 集合吗?我正在处理以下情况:在 AD 上创建一个包含用户的新组后,以编程方式将其包含在 TFS 集合中。

如果可能的话,我对 .NET C# 解决方案感兴趣。

【问题讨论】:

    标签: c# tfs active-directory tfs-sdk


    【解决方案1】:

    查看this帖子中的答案:

    您可以使用代码 sn -p 将 windows 用户添加到 TFS。

    "

    var collection = new TfsTeamProjectCollection(new Uri("http://mytfs:8080/tfs/MyCollection"));
    var identityService = collection.GetService<IIdentityManagementService>();
    var readIdentity = identityService.ReadIdentity(IdentitySearchFactory.AccountName, @"[domailName here]\" + userName, MembershipQuery.Direct, ReadIdentityOptions.None);
    

    "

    其他有用的帖子供您参考:

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/ed719386-925b-49a3-a7d7-5c2a147c7da2/add-ad-group-to-tfs-group-programmatically?forum=tfsadmin

    How to add users programmatically to TFS

    【讨论】:

      猜你喜欢
      • 2013-11-01
      • 2011-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多