Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

How to get the Process Name with minimal privilege?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
A1b2c3d4@community.nospam - 14 Mar 2006 19:41 GMT
Hi,

System.Diagnostics.Process.GetCurrentProcess().ProcessName fails for a
caller with minimal privilege on Windows 2003 Server:
System.InvalidOperationException - Couldn't get process information from
remote machine.
System.ComponentModel.Win32Exception - Access is denied.

It works ok on Windows 2000 Professional.

A web search concerning this issue suggests that this is considered to be a
bug in 2003 Server in some quarters.  The only work-around that I've come
across so far is to grant the caller access to the performance counters.  
This is unacceptable.

Can anyone suggest another way for a caller with minimal privilege to
discover the name of the Win32 process within which it is executing?  I don't
mind if it involves Interop, just as long as it works with minimal privilege.

Thanks
David Razzetti
"Peter Huang" [MSFT] - 15 Mar 2006 03:50 GMT
Hi David,

The System.Diagnostics.Process Class uses performance data to obtain
information on processes on the system.
So the user needs to be added to the "Performance Monitor Users" Group to
call run the Process.GetCurrentProcess.ProcessName.
If you do not want to add the user into the group and you just want to get
the process name.
You may try to use
System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase and
parse the process name which is the exe file name.

Best regards,

Peter Huang
Microsoft Online Partner Support

Signature

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.