?
Solved

How can I know a process credentials given its name

Posted on 2011-03-01
3
Medium Priority
?
464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Expert Comment

by:Kalpesh Chhatrala
ID: 35009653
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35009677
0
 
LVL 1

Accepted Solution

by:
keenua earned 2000 total points
ID: 35014989
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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

719 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