开发者

add users to team foundation server 2008 using TFS SDK

How do I add users to the contributors group of one of my TFS 2008 projects using T开发者_JS百科FS SDK?


I think does what you need (untested):

# 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)

Translating to C# or other .Net languages should be simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜