如何使用TFS SDK将用户添加到我的某个TFS 2008项目的贡献者组中?
答案 0 :(得分:0)
我认为你需要的(未经测试):
# add me to the Contributors security group on MyTeamProject
$tfs = Get-TfsServer njtfs -all
$user = $tfs.gss.ReadIdentityFromSource($tfs.GSS_SearchFactor::AccountName, "rberg")
$uri = $tfs.css.GetProjectFromName("MyTeamProject").uri
$role = $tfs.gss.ListApplicationGroups($uri) | ? { $_.displayname -match "Contributors" }
$tfs.gss.AddMemberToApplicationGroup($role.Sid, $user.Sid)
转换为C#或其他.Net语言应该很简单。