2015-12-04 16 views
0

我們可以以編程方式將用戶和用戶組添加到TFS,並使用用於團隊項目的管理環境在TFS中添加AD用戶/組。但是,我可以通過編程方式將用戶組中的用戶從Active Directory添加到TFS集合中嗎?我正在處理以下情況:在用AD創建一個新用戶組之後,以編程方式將其包含在TFS集合中。將活動目錄中的用戶和用戶以編程方式添加到TFS

如果可能,我對.NET C#解決方案感興趣。謝謝。

回答

0

入住this後回答:

您可以使用代碼片段到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

相關問題