I"m currently writing a tool to allow my users of a TS/Citrix server to view/kill there own processes. I'm using Visual Studio/Visual Basic 2003 .NET and the tool works great for administrators. However when I run the tool under a normal user rights I get the following error:
************** Exception Text **************
System.ComponentModel.Win32Exception: Access is denied
at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited)
at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId)
at System.Diagnostics.Process.get_Modules()
at System.Diagnostics.Process.get_MainModule()
at System.Diagnostics.Process.get_ProcessName()
at TerminateProcess.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Basically this error appears when the following lines are executed:
Dim myProcesses() As Process
Dim myProcess As Process
myProcesses = Process.GetProcesses
' Iterate through the process array.
For Each myProcess In myProcesses

I'm guesing its because the users don't have rights to view other peoples processes. So I need to know how to change my code so that the tool only displays processes/terminates processes that the user has access to. I would appreciate any help greatly.. Thanks