开发者

Kicking off a Performance Monitor Data Collector Set via PowerShell?

开发者 https://www.devze.com 2023-01-17 16:43 出处:网络
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开发者_StackOverflow中文版 monitors a condition on the system and when it detects

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开发者_StackOverflow中文版 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?


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 :)


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"
0

精彩评论

暂无评论...
验证码 换一张
取 消