Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process.GetProcesses returns processes of all logged on users?

Tags:

process

c#-4.0

In a windows environment where multiple users are allowed to log on to a machine simultaneously, when we call Process.GetProcesses() , does it return the processes of the logged on user who is making this call or does it return processes of all the logged on users. I had a look at the MSDN page but couldnt find this information.

like image 301
Manan Shah Avatar asked Oct 07 '22 13:10

Manan Shah


1 Answers

This function returns all the process resources running on the local computer.
You can see it on MSDN (I also check it on my computer..)

Return Value

Type: System.Diagnostics.Process[]
An array of type Process that represents all the process resources running on the local computer.

If you are interesting in getting processes of specific user look at the following code - http://www.codeproject.com/Articles/14828/How-To-Get-Process-Owner-ID-and-Current-User-SID

like image 118
Dor Cohen Avatar answered Oct 13 '22 10:10

Dor Cohen