Why do I need to be admin to read .NET CLR Memory performance counters

.net, c#, performancecounter

Solution

You only need to be in group Performance Monitor Users. Simply adding your non admin user to that group should fix the problem.

Problem

I couldn't find the ".NET CLR Memory" counter category programmatically (in c#), as in this question. Running as admin solved the issue. But why do I need to do this? Is there an alternative? I want readonly access, to see GC generation collections inside my app for profiling purposes. Preferably without having to run the app with admin privileges. Edit: - I can see the Memory performance counters in the Performance Monitor tool, without running as Admin - Without running as Admin, I can get a shortened (but not empty) list of performance counter categories programmatically, but this doesn't include the one I'm interested in. - Our corporate setup is a bit crazy: I have admin privileges, but am not a member of the local admins group. I do have the privileges to add myself, but every 30 minutes or so some automated process removes me. Don't know if this affects anything - Adding myself to the Performance Monitor Users group had no effect (unless I need to reboot first)

Original source

Related problems