如何使用 TFS API 获取 TFS 用户组和特定组中的用户?

如何使用 TFS API 获取 TFS 用户组和特定组中的用户?

问题描述:

我想在 DropDown 中列出 TFS 用户组,并且根据用户组的选择,我需要使用 TFS API 填充该特定组中的用户.

I want to list TFS user groups in a DropDown and based on selection of user group I need to populate users in that particular group using TFS API.

这个页面有几个例子:http://blogs.microsoft.co.il/blogs/shair/archive/2009/01/14/tfs-api-part-4-get-tfs-user-list-mail-sid-account-domain.aspx

最后一个例子可能是最相关的.

The last example is probably the most relevant.

IGroupSecurityService gss = (IGroupSecurityService)server.GetService(typeof(IGroupSecurityService));
Identity[] UserId = gss.ReadIdentities(SearchFactor.Sid, SIDS.Members, QueryMembership.None);