These Data Collector Sets don’t run
automatically; however, you can write a script to run them, and then
schedule the script. The command you use is logman and the basic syntax is
logman start "system\data-collector-set-name"
For example, if you want to start the System Performance Data Collector Set, you can use the following command:
logman start "system\system performance"
Tip
If you create a User Defined Data Collector Set, you
don’t need to schedule this from the command line. Instead, you can
schedule it using the Schedule tab of the Data Collector Set. However, you can’t modify any of the predefined System Data Collector Sets.
The following table shows some of the switches you can use with logman.
logman Switches | Comments |
---|
Start a Data Collector Set.
logman start "node\data-collector- set-name" C:\>logman start "system\system diagnostics"
| The node is System for the predefined System Data Collector Sets and User Defined
for any Data Collector Sets created by you or other administrators. The
example starts the System Diagnostics Data Collector Set. |
Stop a Data Collector Set.
logman stop "node\data- collector-set-name" C:\>logman start "system\system diagnostics"
| The LAN Diagnostics Data Collector Set included in Windows Server 2008 doesn’t have an automatic stop. You can use the logman stop command to stop it (or any other Data Collector Set). |
Start or stop on a remote computer.
-s computer-name C:\>logman start "system\system performance"
| You can run the command on remote computers using the -s switch. |
Send commands to Event Trace Sessions.
-ets logman stop "node\data- collector-set-name" C:\>logman start "system\system performance" -ets
| This switch sends commands to Event Trace Sessions directly without saving or scheduling them. |
Use the following steps to create a script to start
the System Performance Data Collector Set. The next section shows how
to schedule this script with the Task Scheduler.
Steps | Action |
---|
1. Start Notepad. | Launch an instance of Notepad by clicking Start, typing Notepad, and pressing Enter. |
2. Add script to Notepad file. | Type the following line in the Notepad file:
logman start “system\system performance” -ets
|
3. Save the script. | Press Ctrl+S to save the file. Browse to the root of C:. Create a folder named Scripts if you don’t have one already. Browse to the C:\Scripts folder. In the File Name section, type sysperf.bat.
Tip
If you don’t include the .bat in the filename, the file will be as a
text file with a .txt extension. You can schedule and run a batch file
with a .bat extension, but you can’t schedule or run a text file.
|
4. Clean up. | Click Save. Close all open windows. |