all groups > asp.net security > august 2004 >
You're in the

asp.net security

group:

Required permissions to set Process.PriorityClass in Win 2003 serv



Required permissions to set Process.PriorityClass in Win 2003 serv Paul Roberts
8/29/2004 9:11:07 PM
asp.net security: 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
Re: Required permissions to set Process.PriorityClass in Win 2003 serv Nicole Calinoiu
8/30/2004 9:22:05 AM
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?



[quoted text, click to view]

AddThis Social Bookmark Button