Link to home
Start Free TrialLog in
Avatar of quanmac
quanmac

asked on

System.Diagnostics.Process.GetProcesses Error Message

Hello everyone,

I've been getting this error message when I try to execute this code:

System.Diagnostics.Process.GetProcesses()

So far, I've granted the ASPNET user account access to the performance counter group because I was getting an Access Denied error, that is fixed and now I get this error:

Process performance counter is disabled, so the requested operation cannot be performed.

I've been trying to figure out how to enabled the process performance counter but I can't figure it out.

Can anyone show me how to do this?
Avatar of TornadoV
TornadoV
Flag of United States of America image

Microsoft recommended an only workaround which is to add the user to Performance Counter Users Group
http://msdn.microsoft.com/netframework/programming/bcl/faq/SystemDiagnosticsProcessFAQ.aspx#Question7
Avatar of quanmac
quanmac

ASKER

The Performance Counter Users Group is missing from my list of groups.

I have:

Performance Logs Users
and
Performance Monitor Users

I've added the account to both of these and I still get the error:

Process performance counter is disabled, so the requested operation cannot be performed.
ASKER CERTIFIED SOLUTION
Avatar of TornadoV
TornadoV
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of quanmac

ASKER

So if i impersonate an account with the required priviledges, then wouldn't be able to access anything else except for the web app?

I am worried that someone would be able to gain access to the OS and manipulate it.
Avatar of quanmac

ASKER

Am I able to impersonate an account in my C# code and run the System.Diagnostics.Process.GetProcesses() line and then revert back to the ASPNET account?