Freigeben über


Command-Line Utility for the Best Practices Analyzer Tool

You can perform the same scans at a command prompt that you can by using the graphical user interface (GUI) version of the Best Practices Analyzer tool for Team Foundation Server. For example, you might scan your deployment at set intervals by running the command-line tool as part of an automated script. In some cases, a product-support technician might instruct you to run the command-line tool to help you solve a problem.

The command-line tool collects and analyzes data. As it collects data, the tool performs the following functions:

  • Queries the computers (TargetComputer) to retrieve the information that is required by the tests that you specified for the scan (TestType).

  • Writes the information that the tool collects to output data files. For information about these files, see Reports that the Best Practices Analyzer Tool Generates.

During analysis, the tool processes the data that it collects based on the test rules. For more information, see Rule Checking Performed by the Best Practices Analyzer Tool.

After you install the GUI version, you can locate the command-line tool TfsBpaCmd.exe in Drive:/Program Files/Microsoft Team Foundation Server Best Practices Analyzer.

If you specify no parameters, the command-line tool collects data from the local computer based on all rules in the health check.

Required Permissions

To use the TfsBpaCmd.exe command, you must be a member of the Team Foundation Administrators security group on the application-tier server for Team Foundation and a member of the sysadmin security group on the computers that are being scanned. For more information, see Prerequisites for Using the Best Practices Analyzer Tool.

Note

Even if you are logged on with administrative credentials, you must open an elevated Command Prompt to perform this function on a server that is running Windows Server 2008. To open an elevated Command Prompt, click Start, right-click Command Prompt, and click Run as administrator. For more information, see the Microsoft Web site.

TfsBpaCmd.exe [options]

Parameters

Option

Description

-cfg File

Specifies the configuration XML file that determines the rules to check as the tool collects data. By default, the tool uses TfsBpa.Config.xml, which is located in Drive:/Program Files/Microsoft Team Foundation Server Best Practices Analyzer/en.

For this option, specify TfsBpa.Config.xml, which calls the following files:

  • Tfs.HealthCheck.Config.xml, which contains tests that determine whether the computers that you specify meet configuration and operational requirements.

  • Tfs.InstallCheck2005.Config.xml, which contains tests that determine whether the computers that you specify meet the prerequisites for an installation of Visual Studio 2005 Team Foundation Server.

    - or -

  • Tfs.InstallCheck2008.Config.xml, which contains tests that determine whether the computers that you specify meet the prerequisites for an installation of Visual Studio Team System 2008 Team Foundation Server.

-dat File

Specifies the data XML file into which the tool should write the data that it collects. If you specify the name of a file that is not in the current directory, the tool uses the name that you specified for the output file. If you specify the name of an existing file and the analyze (-a) option, the tool performs the following tasks:

  • Reads the data in the file.

  • Analyzes the data.

  • Overwrites the file with the output of the analysis.

By default, the tool writes the data into TfsBpaCmd.DateTimeStamp.data.xml, in a folder that is named tfsbpaDateTimeStamp.

  • For Windows 2000 Server and Windows XP Home Edition, Windows XP Professional, Windows Server 2003, the tool writes to files in Drive:\Documents and Settings\UserName\Application Data\Microsoft\TfsBPA

  • For Windows Vista and Windows Server 2008, the tool writes to files in Drive:\Users\UserName\AppData\Roaming\Microsoft\TfsBPA

-in File

Specifies that the tool should load the data in File before scanning the computers. You can either use this option to collect data from additional categories in the same file or to reanalyze previous data. If you specify File as "$", the tool uses the file that is named output.Label.DateTimeStamp.xml and that has the most recent date-time stamp.

-l Label

Specifies a label for the scan. If you do not specify a label, the tool uses the date and time of the scan as the label.

The tool uses the label of the scan to name the output file and folder. Also, you use the label to identify the scan in a list when you open the GUI. The value of the output file name is TfsBpaCmd.Label.DateTimeStamp.data.xml. The tool writes output files into a folder that is named tfsbpa.Label.DateTimeStamp.

-GS Name Value [...]

Specifies the computers that the tool should scan. By default, the tool scans TFSServerURL http://localserver:8080, but you can specify the options in the following table instead:

Name

Value

TFSServerURL

Specifies the name of the application-tier server for Team Foundation. You must specify this option if you perform a health check. When you specify this option, you must use the syntax http://ComputerName:PortNumber (for example, http://myserver:8080).

By default, the tool scans http://localserver:8080.

ATMachineName

Specifies the name of the application-tier server for Team Foundation. You must specify this option to perform a preinstall check of the application-tier server in a dual-server deployment.

DTMachineName

Specifies the name of the data-tier server for Team Foundation. You must specify this option to perform a preinstall check of the data-tier server in a dual-server deployment.

ClientMachineName

Specifies the name of a computer that is running or that will run a Team Foundation client. You must specify this option only if you want to scan a client computer.

MachineName

Specifies the name of the server that will run Team Foundation Server. You must specify this option to perform a preinstall check for a single-server deployment.

WSSMachineName

Specifies the name of the remote server on which SharePoint Products and Technologies is installed. You must specify this option only if you perform a preinstall check of the remote server.

-r Parameter[=Value][,...]

Specifies that the tool should include only those settings and objects that match the categories that are based on the parameters that you specify. All restrictions have a default value. You must specify only those categories that you want to override.

Note

If you do not specify any restrictions, the tool runs a health check without any restrictions.

The configuration XML files define categories for settings and objects. When you restrict a scan to one category, the output of the scan includes only the information that the tool collected for the category that you specified. You can include more than one category by specifying multiple parameters.

The valid categories that you can specify might vary with different versions of the configuration XML files. Categories are identified as RestrictionType Name in the XML files. To determine the categories and levels that are valid for your version of the configuration files, run TfsBpaCmd.exe -?.

You can specify the parameters and values in the following table:

Parameter

Value

GetDirPerms

Specifies whether the tool should run the tests that check directory permissions.

  • DirPermsNo   Ignores the tests for checking directory permissions.

  • DirPermsYes   (Default) Runs the tests for checking directory permissions.

GetEventLogs

Specifies whether the tool should run the tests that collect information from event logs.

  • EVNo   Ignores the tests for collecting information from event logs.

  • EVYes   (Default) Runs the tests for collecting information from event logs.

ListInstallsAndUpdates

Specifies whether the tool should run the tests that retrieve information about recent installations and updates.

  • IUNo   Ignores the tests for retrieving information about recent installations and updates.

  • IUYes   (Default) Runs the tests for retrieving information about recent installations and updates.

TargetComputer

For a health check, specifies the computers to be scanned.

  • LocalServer   (Default) Scans the application-tier server, the data-tier server, and the client computer.

  • Server   Scans the application-tier and data-tier servers.

  • Local   Scans only the client computer.

TestSuite

Specifies tests that are associated with the installation of Team Foundation Server.

  • AllInstall   (Default) Runs the complete set of preinstall and postinstall tests.

  • PreInstall   Runs tests that check whether system requirements and software prerequisites are met.

  • PostInstall   Runs tests that should continue to pass after Team Foundation Server is installed.

    Note

    The PostInstall category contains no tests in this release.

TestTargets

Specifies the target computers for which a test should be run.

  • ClientATDT   (Default) Runs tests that are defined for the client computer, the application-tier server, and the data-tier server.

  • ClientAT   Runs tests that are defined for the client computer and the application-tier server.

  • Client   Runs tests that are defined for the client computer only.

TestType

Specifies the type of scan to run.

  • HealthCheck   (Default) Runs tests to determine the health of the target computers. These tests are defined in the Tfs.HealthCheck.Config.xml file.

  • InstallCheck2005   Runs tests to determine whether prerequisites for an installation of Visual Studio 2005 Team Foundation Server are met. These tests are defined in the Tfs.InstallCheck2005.Config.xml file.

  • InstallCheck2008   Runs tests to determine whether prerequisites for an installation of Visual Studio Team System 2008 Team Foundation Server are met. These tests are defined in the Tfs.InstallCheck2008.Config.xml file.

TestWebServices

Specifies whether the tool should run the tests that check Web services.

  • WSNo   Ignores the tests for checking Web services.

  • WSYes   (Default) Runs the tests for checking Web services.

-th NumberOfThreads

Specifies the maximum number of threads to run at the same time. By default, the value of this option is 50.

-to Time

Specifies the default time (in seconds) that the tool will wait to collect data from a server that you specify. By default, the value of this option is 300.

-c

Specifies that the tool should collect but not analyze data from the servers that you specify. By default, the tool obeys this option if you do not specify either the collect (-c) or the analyze (-a) option.

-a

Specifies that the tool should analyze the data XML file that it generated in a previous operation. You can use this option to analyze an existing output file. You can also use this option to collect and analyze data for a new scan, either by specifying a data XML file that is not in the current directory or by not specifying a data XML file.

-e

Specifies that the tool should not record in the output file any values that are marked NotForExport in the configuration XML files.

-s

Specifies that the tool should run the scan by using the parameters that the GUI version stored in the registry.

-?

Specifies that help information for the tool should appear.

See Also

Concepts

Rule Checking Performed by the Best Practices Analyzer Tool

Other Resources

Using the Best Practices Analyzer Tool