Process.Getprocesses() problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I try
Process [] remoteByName = Process.GetProcesses();
it works
but when I try
Process [] remoteByName = Process.GetProcesses("localhost");
it fails with invalid operation
please Help me!
Threre is no way to find help on the internet, i am desesperate.
../Jane
 
"localhost" is not a valid machine name.
Use the real machine name:
.....= Process.GetProcesses(Environment.MachineName);

Willy.
 
Hi Jane,

Try this,

Process ThisProcess = Process.GetCurrentProcess();

Process[] AllProcess = Process.GetProcessesByName(ThisProcess.ProcessName);

Harris.
 
Hi Willy,
Thank you for your answer
ok it is working my computer name but with a remote computer name it fails:
for example:
Process [] remoteByName = Process.GetProcesses("hlshfmpp05");
hlshfmpp05 is a remote machine and I am administrator on it.

Do you have any Idea?
for me it is a security problem but I do'nt know what to configure!
thx

Willy Denoyette said:
"localhost" is not a valid machine name.
Use the real machine name:
.....= Process.GetProcesses(Environment.MachineName);

Willy.

Jane said:
Hi,
I try
Process [] remoteByName = Process.GetProcesses();
it works
but when I try
Process [] remoteByName = Process.GetProcesses("localhost");
it fails with invalid operation
please Help me!
Threre is no way to find help on the internet, i am desesperate.
./Jane
 
Jane said:
Hi Willy,
Thank you for your answer
ok it is working my computer name but with a remote computer name it
fails:
for example:
Process [] remoteByName = Process.GetProcesses("hlshfmpp05");
hlshfmpp05 is a remote machine and I am administrator on it.

Do you have any Idea?
for me it is a security problem but I do'nt know what to configure!
thx


Not sure what error you got, but I'm pretty sure that you are NOT running
your code as an administrator on "hlshfmpp05".

Willy.
 
You are right!
I am running the code on HLSSERVERPP01 as domain administrator!
I try to get all HLSHFMPP05 process from HLSERVERPP01.

thx


Willy Denoyette said:
Jane said:
Hi Willy,
Thank you for your answer
ok it is working my computer name but with a remote computer name it
fails:
for example:
Process [] remoteByName = Process.GetProcesses("hlshfmpp05");
hlshfmpp05 is a remote machine and I am administrator on it.

Do you have any Idea?
for me it is a security problem but I do'nt know what to configure!
thx


Not sure what error you got, but I'm pretty sure that you are NOT running
your code as an administrator on "hlshfmpp05".

Willy.
 
Back
Top