Access is Denied error using Process.GetProcesses()

E

Elliot

I am sure this has been covered as I am just now "sinking" into asp.net.

I am getting an "Access Denied" error when the following code tries to execute:

Dim myProcesses() As Process
Dim myProcess As Process
myProcesses = Process.GetProcesses() 'This line FAILS!

I am using a local machine using Win 2K and IIS 5.0.

Any help is appreciated.

Thank you,
Elliot Semmelman
 
H

Hernan de Lahitte

The ASPNET account (configured by default) impersonated by the worker
process has no privileges to access this API. You should use a higher
privilege account with the required permissions. Unfortunately, this goes
against the principle of the low privilege account (ASPNET account is a good
sample of this), so one thing you could do, is to authenticate the site with
an administrator like account or any account with the required privileges,
and use impersonation true in the web.config file. This way, nobody with the
required permissions will be able to access restricted resources.
 
A

Arvind.R

Hi Elliot,

Hernan is right. You would have to impersonate an account that has these
rights. You could do that, say in the web.config or the machine.config
file. You might want to check out this article:

306158.KB.EN-US INFO: Implementing Impersonation in an ASP.NET Application

http://support.microsoft.com/?id=306158

You could also take a look at this article for more infor on the process
identity used by asp.net:

317012.KB.EN-US INFO: Process and Request Identity in ASP.NET

http://support.microsoft.com/?id=317012


Thanks, Arvind Rajendran
Microsoft, ASP.Net

This posting is provided "as is" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top