Reputation: 30293
I have a need to kick off a Data Collector Set that I've predefined. I'm going to be writing a PowerShell script that monitors a condition on the system and when it detects that condition, it begins the Data Collector Set. How can I start this Data Collector Set?
Upvotes: 1
Views: 5309
Reputation: 741
You can also access the collector sets programmatically by referencing the PLA.dll assembly in %windir%\System32\PLA.dll (Vista or later). You can then start a collection with code similar to:
IDataCollectorSet cs = new DataCollectorSet();
cs.Query("Collector set name", null);
cs.start(false);
Feel free to translate that to powershell :)
Upvotes: 4
Reputation: 201602
There may be a .NET way to do this but I do know you can use logman.exe to start/stop these e.g.:
logman start "My DataCollectorSet"
logman stop "My DataCollectorSet"
Upvotes: 4