Access is Denied error using Process.GetProcesses()

Discussion in 'ASP .Net Security' started by Elliot, Jan 19, 2004.

  1. Elliot

    Elliot Guest

    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
    Elliot, Jan 19, 2004
    #1
    1. Advertising

  2. 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.

    --
    Hernan de Lahitte - MSDE
    Lagash Systems S.A. - Buenos Aires, Argentina
    http://www.lagash.com



    "Elliot" <> wrote in message
    news:...
    > 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
    Hernan de Lahitte, Jan 20, 2004
    #2
    1. Advertising

  3. Elliot

    Arvind.R Guest

    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.
    Arvind.R, Jan 20, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Hwang

    GetProcesses - Access is denied

    David Hwang, Nov 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,416
    David Hwang
    Nov 3, 2003
  2. David Hwang

    Access is denied - GetProcesses()

    David Hwang, Nov 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    2,662
    David Hwang
    Nov 6, 2003
  3. Snig

    Process.GetProcesses()

    Snig, Jun 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,474
  4. Tim Golden
    Replies:
    0
    Views:
    959
    Tim Golden
    Aug 28, 2008
  5. EJS
    Replies:
    0
    Views:
    310
Loading...

Share This Page