Re: Required permissions to set Process.PriorityClass in Win 2003 serv

From: Nicole Calinoiu (nicolec_at_somewhere.net)
Date: 08/30/04


Date: Mon, 30 Aug 2004 09:22:05 -0400

I have no problems setting the priority in this way on Windows 2003 when
code is running from within the (unmodified) default application pool under
the default NetworkService account. Are you receiving an exception or is
the attempted change simply not appearing to have the desired effect? If
the former, what is the exception?

"Paul Roberts" <PaulRoberts@discussions.microsoft.com> wrote in message
news:1DC14FF0-0F9E-492F-8801-DFBD68E4D4ED@microsoft.com...
> Hi All,
>
> I have an asp.net application that needs to set it's priority to normal,
> but
> I get access denied when the below code executes. The reason I have to do
> this is I use a third party com component and it changes the priority to
> high, so I want to bang it on the head to make it normal again.
>
> System.Diagnostics.Process process =
> System.Diagnostics.Process.GetCurrentProcess();
> process.PriorityClass = System.Diagnostics.ProcessPriorityClass.Normal;
>
> The code works just fine if the user has admin rights. I have also tried
> giving the user 'Act as part of the OS' and 'Increase scheduling priority'
> in
> local security settings and neither of these let it work. I should also
> mention that this bit of code works just fine on 2000/XP without changing
> any
> ASPNet permissions. To run on 2003 server I have also changed the
> application to impersonate a new local machine account.
>
> Does anyone know what permission the user needs to change the process
> priority?
>
> Cheers
> Paul
>



Relevant Pages