Command-Line Tool 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 in the deployment to retrieve the information that the rules for each type of scan require.
Writes the information that the tool collects to output data files. For information about these files, see Reports and Messages 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 2010 Best Practices Analyzer.
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 –GS TFSServerURL http://ServerName:Port/VirtualDirectoryName [options]
Parameters
Option |
Description |
---|---|
-cfg File |
Optional. 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 2010 Best Practices Analyzer/en. For this option, specify TfsBpa.Config.xml, which runs the rules in the following files:
|
-dat File |
Optional. 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:
By default, the tool writes the data into TfsBpaCmd.DateTimeStamp.data.xml, in a folder that is named tfsbpaDateTimeStamp.
|
-in File |
Optional. 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 |
Optional. 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 |
Required. Specifies to scan the application-tier server for Team Foundation based on its URL and the value of that URL.
For example, use the following syntax: TFSServerURL http://myserver:8080/tfs |
-r Parameter |
Optional. Specifies the type of scan that the tool should run from the following options:
You can specify only one type of scan to run. For more information, see Rule Checking Performed by the Best Practices Analyzer Tool. |
-th NumberOfThreads |
Optional. Specifies the maximum number of threads to run at the same time. By default, the value of this option is 50. |
-to Time |
Optional. 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 |
Optional. 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 |
Optional. 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 |
Optional. Specifies that the tool should not record in the output file any values that are marked NotForExport in the configuration XML files. |
-s |
Optional. Specifies that the tool should run the scan by using the parameters that the GUI version stored in the registry. |
-? |
Optional. Specifies that help information for the tool should appear. |
Examples
You can use the following command to scan the named server, running the rules for a Team Foundation Server Complete Health Check.
TfsBpaCmd.exe –GS TFSServerURL http://machinename:8080/tfs
You can use the following command to run only those rules in the SharePoint Products Health Check.
TfsBpaCmd.exe –GS TFSServerURL http://machinename:8080/tfs –r SharePointHealthCheck
See Also
Concepts
Rule Checking Performed by the Best Practices Analyzer Tool