Performance counters are great - unless they're not running. So this script illustrates one approach to monitoring the Performance Counter Logs on a given machine, starting them when they stop (for whatever reason) and letting someone know about it.
UPDATE For 2008+ Data Collector Sets: Monitoring and Starting Data Collector Sets with Powershell
I check the registry to determine the current state of a counter log, and use the logman command line utility to start the log when needed. Logman can also tell you the state of the counters, but it's crazy slow. I've been unable to locate a way to do all of this using WMI and the interweb has been less helpful than usual on this issue. So here's my solution:
I received a request from a professor to aggregate all of the feedback for a given Amazon.com seller. The problem is that Amazon.com seller feedback is displayed 25 at a time on the feedback page and, of course, even if we could get all of them on one page, there is NO way we're going to manually move all the records to a database when there are 50,000+ feedback records.
In this post, I will discuss one approach to solving this problem