I made a program that scans the subnet of my company and let me do lot of things on single client or on all clients together (like shutdown all). i leave a screenshot that show how my program works.
For some needs im trying to add a function with the name 'Process Kill' that shows me the list of the running Tasks (only 'Applications' Tab, not Background or System tasks) of the client selected and let me kill the one i choose.
The problem is that i found only functions that shows me all the process opened (that usually are not less than 100 considering system tasks) and i dont like it.
So im asking to you if someone knows how to get a list only of the Taksk opened in the 'Applications' tab.
If u want add the code that let me kill it remotely too, will be useful.
Thanks!
Updates:
This is what im actually using to get all the Processes in a MenuStrip Items
//IP Address of the remote machine
string ipAddress = row.Cells["IP"].Value.ToString();
ManagementScope scope = new ManagementScope(@"\\" + ipAddress + @"\root\cimv2");
scope.Options = connectoptions;
//Define the WMI query to be executed on the remote machine
SelectQuery query = new SelectQuery("select * from Win32_Process");
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, query)){
ManagementObjectCollection collection = searcher.Get();
foreach (ManagementObject process in collection){
(conMenuStripIP.Items[5] as ToolStripMenuItem).DropDownItems.Add(process["Name"].ToString());
}
}