Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用TFS SDK向Team Foundation Server 2008添加用户_Tfs_Tfs Sdk - Fatal编程技术网

使用TFS SDK向Team Foundation Server 2008添加用户

使用TFS SDK向Team Foundation Server 2008添加用户,tfs,tfs-sdk,Tfs,Tfs Sdk,如何使用TFS SDK将用户添加到我的一个TFS 2008项目的参与者组中?我认为这是您需要的(未经测试): 翻译成C#或其他.Net语言应该很简单 # add me to the Contributors security group on MyTeamProject $tfs = Get-TfsServer njtfs -all $user = $tfs.gss.ReadIdentityFromSource($tfs.GSS_SearchFactor::AccountName, "rberg

如何使用TFS SDK将用户添加到我的一个TFS 2008项目的参与者组中?

我认为这是您需要的(未经测试):

翻译成C#或其他.Net语言应该很简单

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