On systems where I’ve implemented minimally privileged domain service accounts for SQL Server services I’ve run into a problem accessing perf counter data using the System.Diagnostics.PerformanceCounter object. If I run perfmon the counters all return valid results, and I get proper values from the OS counters (Pct Processor Used, Available Memory, etc.) through the PerformanceCounter object, but the SQL Server counters all return zero.
The service accounts are part of an AD group, and I’ve added that group to both the Performance Log Users and Performance Monitor Users groups in the local machine.
Any idea why this is happening? I’ve got scripts that have worked everywhere else, but this one client, and I’m not sure where to look to find it. (I’ve refreshed the counters - they work in perfmon.)