By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,168 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,168 IT Pros & Developers. It's quick & easy.

GetProcessesByName() returns "Access is Denied" when trying to access remote host.

P: n/a
Hi -

I have an application that is monitoring a process on another machine.
This application runs as a service. The error that I am getting when
this runs is:

Couldn't get process information from remote machine.
System.ComponentModel.Win32Exception: Access is denied

I have searched the web extensively to solve my problem, but have found
nothing. I find a lot of people finding errors when using to
get a process, but thats not what I'm trying to do. Specifically, here
is the code that fails:

Process[] aryProcess =
System.Diagnostics.Process.GetProcessesByName(proc essName, serverName);

I know that there is an issue with permissions and that you have to
have administrator rights. I set the properties of my service to log
on under the administrators account. The service is running on Windows
Server 2003. The remote server is Windows 2000.

If anyone has any ideas of what I need to do to get this to work, I
appreciate it!!

May 19 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a
you probably used administratior credentials for host machine which is
different that admin in remote machine. (not in case you use Domain
Admin and both machines are members)

you should use impersonalization
se here for details

I hope this helps
Galin Iliev[MCSD.NET]

May 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.