Solved

How can I know a process credentials given its name

Posted on 2011-03-01
3
457 Views
Last Modified: 2013-12-17
I need to know if a process is currently being run with administrator's privileges.
Can I know that given the process' name that I get by enumerating all running processes?
0
Comment
Question by:yossikally
3 Comments
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
Comment Utility
0
 
LVL 9

Expert Comment

by:rawinnlnx9
Comment Utility
0
 
LVL 1

Accepted Solution

by:
keenua earned 500 total points
Comment Utility
you'll need to add "using System.Diagnostics" at the beginning

By the user name you can define whether current process is running with administrator privileges.
Process[] processes = Process.GetProcesses();
foreach (Process p in processes)
{
  Console.WriteLine("Process: " + p.ProcessName);
  Console.WriteLine("User Name: " + p.StartInfo.UserName);
  Console.WriteLine();
}

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now