2012-12-03 65 views

回答

1

看着powershell文檔(C:\ Program Files(x86)\ Microsoft Team Foundation Server 2010 Power Tools \ Help \ PowerShellCmdlets.mht),看起來沒有選項可以將用戶添加到TFS中的組。但是,如果您安裝了TFS Power Tools,則可以在命令行中使用tfssecurity工具。

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>tfssecurity /? 
[...] 
    /g+ groupIdentity memberIdentity (/collection:CollectionURI | /server:ServerURI) 
     Adds a user or a group to an existing group. 
[...] 
Identity Specifiers: 

    sid:sid - References the identity with the specified SID. 
     Example: sid:S-1-5-21-2127521184-1604012920-1887927527-588340 

    n:[domain\]name - References the identity with the specified name. For Windows, name is the logon name. If the referenced identity is in a domain, the domain name is required. For application groups, name is the group display name and domain is the URI or GUID of the containing project. In this context, if domain is omitted, the scope is assumed to be collection-level. 
     Example: To reference the identity of the user "John Peoples" in the domain "Datum1" at the fictitious company "A. Datum Corporation, you would use the following syntax: 
      n:DATUM1\jpeoples 
     Example: To reference application groups, you could use either of the following syntaxes: 
      n:"Full-time Employees" 
      n:00a10d23-7d45-4439-981b-d3b3e0b0b1ee\Vendors 
[...] 

因此,它看起來像:

tfssecurity /g+ [ProjectName]\Contributor Domain\UserName /collection:http://yourTfs:8080/ProjectCollection 
+0

爽,會給一個嘗試的明天。謝謝 – timB33