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

Hello,

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?
Data-BaseAsked:
Who is Participating?
 
Gene_CypCommented:
The above is an alternative, the one below relates to using GetProcesses()
 
http://www.codeproject.com/KB/cs/CustomTaskManager.aspx 
0
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:
Thanks,

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


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

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(),
proc["SessionId"].ToString());
}

Open in new window

0
 
Data-BaseAuthor Commented:
Thanks allot :-)

that was cool
0
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.