PC Review


Reply
Thread Tools Rate Thread

Access denied to Process.StartTime for User account

 
 
dfcastles@yahoo.com
Guest
Posts: n/a
 
      16th Nov 2005
After upgrading to the DotNet Framework 2.0, my app now generates an
"Access Denied" exception when trying to look at the StartTime of
the processes running on a Win2K server. This code was running without
errors on the site using the DotNet Framwework 1.1. I am using the
System.Diagnostics.Process object to get a list of all running
processes and then looking through the list at the StartTime of each
Process.

....

System.Diagnostics.Process oCurProcess =
System.Diagnostics.Process.GetCurrentProcess();
System.Diagnostics.Process[] oProcessList;
oProcessList =
System.Diagnostics.Process.GetProcesses(oCurProcess.MachineName);

for(int p=0; p<oProcessList.Length; p++)
{
if (oProcessList[p].Id == iMRUProcessId)
{
System.TimeSpan oTimeSpan = oProcessList[p].StartTime -
dtMRUProcessStartTime;

>>> the exception occurs here when trying to get the StartTime. The stack trace shows the last thing called was System.Diagnostics.ProcessManager.OpenProcess



On some other customer sites running Win 2003 Servers, we had to add
the users of the app to the Performance Log Users group in order to
read the StartTimes of the running processes. I would like to have the
app run on normal user acccounts but I keep running into permission
issues.

I've been testing some code to use impersonation to temporarily use
another user account to view the starttimes of the running processes,
but now have found that using the API call LogonUser (needed for
impersonation) requires the calling process to have the SE_TCB_NAME
(act as OS) priv on Win 2K Servers. It's a catch 22. MSFT warns about
granting this to a process due to its power, so it doesn't seem like
the thing to do for normal users.

Is there a way to tell if a particular ProcessId is still running and
for how long it has been running without having to grant super powers
to the users of the app? Any light shed, thoughts or ideas are
appreciated.

thanks
David

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User account on External Hd Access Denied ssilverwood Windows XP Accessibility 3 10th Dec 2007 06:56 PM
Access denied to my user account klzwicker@eastlink.ca Windows XP Help 1 9th Mar 2007 05:20 AM
Access to old user account is denied mitch Windows XP General 1 9th Jul 2004 05:53 AM
Access Denied to old user account mitch Windows XP Security 0 9th Jul 2004 05:46 AM
denied access to unlock user account Henrico Microsoft Windows 2000 Security 1 5th Feb 2004 06:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:49 PM.