C# list process on a remote system using macine address+adminname+password ?


I need to have a tool to list processes on a remote servers (our customers)
the tool is part of a program that I'm working on to diagnose the system

the Process.GetProcesses("machine"); does not work, I need a way to enter the machine address + the username/password for the admin manually

our computers are not part of the domains at the customers but we have usernames/passwords with admin access

any help?
Who is Participating?
The above is an alternative, the one below relates to using GetProcesses()
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Data-BaseAuthor Commented:

I will check it now :-)
Data-BaseAuthor Commented:
wow this is cool

but how I can list the services?
Data-BaseAuthor Commented:

now I get confused !!!

how to use the above with this code?

ConnectionOptions co = new ConnectionOptions();;
co.Username = "administrator"; //any account with appropriate privileges
co.Password = "pppppp";
string remMachine = "machineName";
ManagementScope scope = new ManagementScope(@"\\" + remMachine +
@"\root\cimv2", co);
SelectQuery selectQuery = new SelectQuery("Select Name, SessionId
from Win32_Process");
using(ManagementObjectSearcher searcher =
new ManagementObjectSearcher(scope, selectQuery))
foreach (ManagementObject proc in searcher.Get())
Console.WriteLine("{0}, {1}",proc["Name"].ToString(),

Open in new window

Data-BaseAuthor Commented:
Thanks allot :-)

that was cool
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.