perfmon: User-defined data collector set doesn’t run as scheduled
In the Computer Management console in one of the affected versions of Windows, you create a data collector set in the Performance > Data Collector Sets > User Defined folder. You configure a schedule as part of the data collector set definition.
During the scheduled running time, you notice that Performance Monitor does not start collecting data. If you configured the data collector set to save data to a file, the file isn’t created and no data is saved. In Task Scheduler, the task history indicates that the task ran successfully. However, the task didn’t actually do anything.
In Task Scheduler, if you open the scheduled task and then select Actions, the actions list contains Custom Handler.
The list doesn’t contain the expected action, Start a program, which includes the specific commands and arguments.
In the Task Scheduler Library, tasks for data collector sets appear by default in Microsoft > Windows > PLA.
This issue is fixed in Windows 10, version 2004 and later versions and in Windows Server, version 2004 and later versions.
You can manually fix the scheduled task that is associated with a data collector set. To do this, follow these steps:
1)In Task Scheduler, do one of the following to open the Properties dialog box of the affected task:
If the task appears in the Active tasks list in Task Scheduler, double-click the task. Then in the detailed task list, right-click the task and select Properties.
Go to Task Scheduler Library > Microsoft > Windows > PLA, right-click the task, and then select Properties.
2)Select Actions, select Custom Handler, and then select Delete.
3)Select New.
4)In Program/script, type the following string:
1 |
C:\windows\system32\rundll32.exe |
5)In Add arguments, type the following string:
1 |
C:\windows\system32\pla.dll,PlaHost "{Name}" "$(Arg0)" |
In this string, {Name} represents the name of the data collector set.
6)Select OK.
Powershell script to run DataCollectorSet = “rp1”:
1 2 3 |
$datacollectorset = New-Object -COM Pla.DataCollectorSet $datacollectorset.Query("rp1",$null) $datacollectorset.start($false) |
run this script:
1 |
powershell -file c:\path\to\script.ps1 |