Professional Web Applications Themes

Access is Denied error using Process.GetProcesses() - ASP.NET Security

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

  1. #1

    Default Access is Denied error using Process.GetProcesses()

    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 Guest

  2. #2

    Default Re: Access is Denied error using Process.GetProcesses()

    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
    [url]http://www.lagash.com[/url]



    "Elliot" <esemmelmanafgweb.com> wrote in message
    news:e5f48329.0401182241.5325e905posting.google.c om...
    > 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 Guest

  3. #3

    Default RE: Access is Denied error using Process.GetProcesses()


    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

    [url]http://support.microsoft.com/?id=306158[/url]

    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

    [url]http://support.microsoft.com/?id=317012[/url]


    Thanks, Arvind Rajendran
    Microsoft, ASP.Net

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

    Arvind.R Guest

Similar Threads

  1. Replies: 9
    Last Post: March 8th, 11:36 PM
  2. Error: Access Is Denied
    By rs250 in forum Coldfusion Database Access
    Replies: 3
    Last Post: May 12th, 10:31 AM
  3. Access Denied Error
    By TenStar in forum Macromedia Contribute General Discussion
    Replies: 4
    Last Post: August 16th, 06:21 PM
  4. Web Service + Anon Access, but getting 401 Access Denied Error
    By Alex Washtell via .NET 247 in forum ASP.NET Web Services
    Replies: 1
    Last Post: April 5th, 04:57 PM
  5. Access is Denied Error??
    By Nathan in forum ASP.NET Security
    Replies: 0
    Last Post: September 23rd, 07:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139