/a- 命令

在命令提示符下使用 /a- 从服务器级别、集合级别或项目级别组中的成员资格中移除用户或组。 若要从用户界面将用户添加到组中,请参见配置用户、组和权限

所需权限

若要使用 /a- 命令,您必须将**“查看集合级别信息”“查看实例级别信息”权限设置为“允许”,具体取决于是否正在分别使用 /collection/server 参数。 如果您正在更改团队项目的权限,则您还必须将该团队项目的“编辑项目级信息”权限设置为“允许”**。

TFSSecurity /a- Namespace Token Action Identity (ALLOW | DENY) [/collection:CollectionURL] [/server:ServerURI]

参数

参数

说明

Namespace

包含要从其移除用户或组的组的命名空间。 您还可以使用 TFSSecurity /a 命令查看服务器级别、集合级别和项目级别中命名空间的列表。

Token

要在其上设置权限的对象的名称或 GUID。

注意注意
根据您指定的命名空间,标记会有所不同。一些命名空间不具有适用于此命令的令牌。

Action

授予或拒绝的访问权限的名称。 有关有效 ID 的列表,请参见 Team Foundation Server 权限,或使用 TFSSecurity /a 命令来查看对指定命名空间的有效操作的列表。

Identity

用户或组的标识。 有关标识说明符的更多信息,请参见 TFSSecurity 标识和输出说明符

  • ALLOW

    组或用户可以执行 Action 指定的操作。

  • DENY

    组或用户无法执行 Action 指定的操作。

/collection:CollectionURL

如果未使用 /server,则必选。 按以下格式指定团队项目集合的 URL:http://ServerName:Port/VirtualDirectoryName/CollectionName

/server:ServerURL

如果未使用 /collection,则必选。 按以下格式指定应用层服务器的 URL:http://ServerName:Port/VirtualDirectoryName

备注

在 Team Foundation 的应用层服务器上运行此命令。

访问控制项是一种安全机制,它们决定了用户、组、服务或计算机可以在计算机或服务器上执行的操作。

示例

下面的示例为名为 ADatumCorporation 的应用层服务器显示服务器级别可用的命名空间。

提示

本文档示例所提及的公司、组织、产品、域名、电子邮件地址、徽标、人物、地点和事件纯属虚构。不应据此联想或推断到任何真实的公司、组织、产品、域名、电子邮件地址、徽标、人物、地点或事件。

>tfssecurity /a /server:ServerURL 

示例输出:

TFSSecurity - Team Foundation Server Security Tool
Copyright (c) Microsoft Corporation.  All rights reserved.

The target Team Foundation Server is http://ADatumCorporation:8080/.

The following security namespaces are available to have permissions set on them:

     Registry
     Identity
     Job
     Server
     CollectionManagement
     Warehouse
     Catalog
     EventSubscription
     Lab

Done.

下面的示例显示可以在集合级别对 Server 命名空间执行的操作。

>tfssecurity /a Server /collection:CollectionURL 

示例输出:

TFSSecurity - Team Foundation Server Security Tool
Copyright (c) Microsoft Corporation.  All rights reserved.

The target Team Foundation Server is http://ADatumCorporation:8080/.

The following actions are available in the security namespace Server:
    GenericRead
    GenericWrite
    Impersonate
    TriggerEvent

Done.

下面的示例对 Datum1 域用户 John Peoples (Datum1\jpeoples) 的 ADatumCorporation 部署移除服务器级别的“查看实例级别信息”权限。

>tfssecurity /a- Server FrameworkGlobalSecurity GenericRead n:Datum1\jpeoples ALLOW /server:http://ADatumCorporation:8080 

示例输出:

TFSSecurity - Team Foundation Server Security Tool
Copyright (c) Microsoft Corporation.  All rights reserved.

The target Team Foundation Server is http://ADatumCorporation:8080/.
Resolving identity "n:Datum1\jpeoples"...
  [U] Datum1\jpeoples (John Peoples)
Removing the access control entry...
Verifying...

Effective ACL on object "FrameworkGlobalSecurity":
  [+] GenericRead                        [INSTANCE]\Team Foundation Valid Users
  [+] GenericRead                        [INSTANCE]\SharePoint Web Application Services
  [+] Impersonate                        [INSTANCE]\SharePoint Web Application Services
  [+] GenericRead                        [INSTANCE]\Team Foundation Service Accounts
  [+] GenericWrite                       [INSTANCE]\Team Foundation Service Accounts
  [+] Impersonate                        [INSTANCE]\Team Foundation Service Accounts
  [+] TriggerEvent                       [INSTANCE]\Team Foundation Service Accounts
  [+] GenericRead                        [INSTANCE]\Team Foundation Administrators
  [+] GenericWrite                       [INSTANCE]\Team Foundation Administrators
  [+] TriggerEvent                       [INSTANCE]\Team Foundation Administrators

Done.

下面的示例对 Datum1 域用户 John Peoples (Datum1\jpeoples) 的 Collection0 团队项目集合移除集合级别的“查看集合级别信息”权限。

>tfssecurity /a+ Server FrameworkGlobalSecurity GenericRead n:Datum1\jpeoples ALLOW /collection:http://ADatumCorporation:8080/Collection0

示例输出:

TFSSecurity - Team Foundation Server Security Tool
Copyright (c) Microsoft Corporation.  All rights reserved.
The target Team Foundation Server is http://ADatumCorporation:8080/COLLECTION0.
Resolving identity "n:Datum1\jpeoples"...
  [U] DATUM1\jpeoples (John Peoples)
Removing the access control entry...
Verifying...

Effective ACL on object "FrameworkGlobalSecurity":
  [+] GenericRead                        [Collection0]\Project Collection ValidUsers
  [+] GenericRead                        [Collection0]\Project Collection Service Accounts
  [+] GenericWrite                       [Collection0]\Project Collection Service Accounts
  [+] Impersonate                        [Collection0]\Project Collection Service Accounts
  [+] TriggerEvent                       [Collection0]\Project Collection Service Accounts
  [+] GenericRead                        [Collection0]\Project Collection Administrators
  [+] GenericWrite                       [Collection0]\Project Collection Administrators
  [+] TriggerEvent                       [Collection0]\Project Collection Administrators
  [+] GenericRead                        [INSTANCE]\SharePoint Web Application Services
  [+] Impersonate                        [INSTANCE]\SharePoint Web Application Services
  [+] GenericRead                        [Collection0]\Project Collection Build Service Accounts

Done.

请参见

任务

创建集合级别组

其他资源

使用 TFSSecurity 更改组和权限

项目级别组

默认组