แชร์ผ่าน


Proxy command (Team Foundation Version Control)

TFS 2017 | TFS 2015 | TFS 2013

Visual Studio 2019 | Visual Studio 2017 | Visual Studio 2015 | Visual Studio 2013

The proxy command configures your client computer to use a proxy server. Adds, deletes, and lists proxy records about the location and availability of one or more proxy servers within your deployment, including any remote sites.

Prerequisites

To use the proxy command to configure a client computer, you must be a member of the User security group on the local computer. To use the proxy command to work with proxy records, you must have the AdminConfiguration permission. For more information, see Security namespace and permission reference.

Syntax

tf proxy ([/configure [Url]) [/collection:TeamProjectCollectionUrl]
[/login:UserName,[Password]]
tf proxy /add Url [/name:Name] [/site:SiteName] 
[/description:Description] [/default:(global|site|all)] 
[/collection:TeamProjectCollectionUrl] [/login:UserName,[Password]] 
tf proxy /delete Url [/collection:TeamProjectCollectionUrl]
[/login:UserName,[Password]] 
tf proxy /list [Url1 Yrl2 ...] 
[/collection:TeamProjectCollectionUrl] [/login:UserName,[Password]]
tf proxy /enabled:(true|false)

Parameters

Argument

Argument

Description

Url

Identifies the proxy server. You must use the following format: http://proxyServerName:proxyPortNumber.

Where proxyServerName is the name of the proxy server and proxyPortNumber is the assigned listening port (for example, http://server:8081).

TeamProjectCollectionUrl

Identifies the project collection. You must use the following format: http://ApplicationTierServerName:PortNumber/Directory/CollectionName.

Where ApplicationTierServerName is the name of the application-tier server, PortNumber is the assigned listening port, and Directory/CollectionName are the names of the directory and the collection (for example, http://server:8080/tfs/newcollection1).

UserName

Provides a value to the /login option. You can specify a user name value as either Domain<em>UserName or UserName.

Password

Provides a password for the user name.

Option

Option

Description

/configure

Configures your client computer to use a proxy server.

/collection

Specifies the project collection.

/login

Specifies the user name and password to authenticate.

/add

Adds a proxy record to Visual Studio Team Foundation Server about the location and availability of proxy servers on your network.

/name

Associates a name with a proxy record.

/site

Associates an Active Directory domain with a proxy record.

/description

Specifies a description of the proxy record.

/default

Specifies the scope of the proxy record. If you add a proxy record with the default set to global, the first time that a developer performs a get operation, Team Foundation Server will redirect that developer's request to the proxy that is specified by the global record. If you add a proxy record with the default set to site, the first time that a developer from within the specified Active Directory domain performs a get operation, Team Foundation Server will redirect that developer's request to the proxy that is specified by the record that is associated with the site.

You can specify one of the following values:

  • global
  • site
  • all

/delete

Deletes a proxy record from Team Foundation Server.

/list

Lists proxy records in Team Foundation Server.

/enabled

Enables or disables proxy.

  • true
  • false

Remarks

The proxy command has two purposes, and each purpose is aimed at a different type of user.

As a developer, you can use the proxy command to configure your client to use a proxy server or to override the network defaults for a proxy server. This task is similar to configuring Team Explorer to use a proxy.

As a network administrator, you can use the proxy command to add and manage records about the location of various proxy servers within your deployment of Team Foundation Server. You can use these records to help developers configure their workstations to use a proxy. If you define a global proxy, Team Foundation Server can automatically redirect developers to use it. If you have a complex network topology with multiple Active Directory domains in various geographic locations, you can set up multiple records and associate each record with a particular domain. These records can then help you automatically direct developers from each geographical location to the appropriate proxy for their location.

For more information on how to find the tf command-line utility, see Use Team Foundation version control commands.

Examples

The following example automatically detects and configures a client computer to use a proxy, if a proxy record has been established:

c:\projects>tf proxy /configure

The following example overrides any proxy records on Team Foundation Server and configures a client computer to use a specified proxy:

c:\projects>tf proxy /configure Url

The following example adds a global record to Team Foundation Server about the availability of this proxy. The first time that a developer performs a get operation, Team Foundation Server will redirect all requests from that developer to the specified proxy.

c:\projects>tf proxy /add http://server:8081 /default:global /collection:http://tfsserver:8080/

The following example adds a site record to Team Foundation Server for developers in an Active Directory domain, which is named corp, to use this proxy server. The first time that a developer from that domain performs a get operation, Team Foundation Server will redirect all requests from that developer to the specified proxy.

c:\projects>tf proxy /add http://server:8081 /default:site /site:corp /collection:http://tfsserver:8080/