0

如何通过 PowerShell 将贡献者添加到 TFS2010 项目?

4

1 回答 1

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
于 2012-12-03T12:41:01.157 回答