I am troubleshooting some possible performance issues on Windows 10 Enterprise servers and want to setup performance counters for memory, and CPU Utilization for a few processes. I have setup few Perfmon counters and saved it as a xml template on one single server. My idea is to be able to use this template, push it across multiple servers, and then setup the same counters using this template so that i save manual effort of creating same counters across multiple servers. Is there any way to accomplish above tasks via PowerShell v5 and above? any other method to achieve the same via PowerShell?
I have saved my Perfmon counters as a xml template. I found that using - 'New-Object -COM Pla.DataCollectorSet' could be used to create a data collector set. unsure how to proceed further.
For a generic Data Colector set, I usually use 2 CSV files: 1 for computers list, and another for counters such as below:
counters list (CounterList.csv) file with header-
Servers list (SrvList.csv) file with header-
Then I have a simple PS1 that combines the perf counters list with the machine names, and create a "test" Data Collector-
You can either use the commented out scheduling cmds (in the script) to configure scheduled run, or you can use below PS commands to manually start and stop the logger-
You can extend this idea by using
invoke-commandwith a loop (for each computer)to remotely deploy DCS and start,stop,and ask status.see also: https://www.serverbrain.org/system-administration/how-to-use-powershell-to-manage-counter-logs.html https://www.jonathanmedd.net/2010/11/managing-perfmon-data-collector-sets-with-powershell.html