Typeperf and Logman make automating performance counter data gathering much easier. Especially if you use them to log the counters directly to a SQL Server database, so you can then slice and dice, or combine stats across multiple boxs (a god send for complete Dynamics CRM environments).
Generally I’ll use
typeperf for checking I’ve got the basic settings right as it’s a bit quicker to check, and then move over to
logman for the actual work.
But there are a couple of gotchas to watch out for when setting them up. These examples assume you’ve got a system DSN called perfmon pointed at the correct database, you’re using Trusted Connections and you’ve a list of counters in the file