As I know, under the hood, Process
class uses WMI to perform operations on remote machines. If Process
class interface is not enough for your task you can use WMI queries directly.
Authorization
By default, Process
class uses current windows credentials to authorize you on remote machines. If your remote machine has different credentials to login, you can switch context to authorize correctly. It's a little tricky solution but it works. Check this article to see how it can be done.
Anyway, you can use WMI query as I mentioned before to perform authorization and get required data. It's more complex but flexible solution.
Firewall
Ofcourse, firewall can blocks remote connections. WMI uses port 135 by-default to access to remote machine so you need to open it on target machine.
I recommend you to check official documentation about WMI connection to remote machines to set up all configurations correctly.
Other approaches
You can use client-server architecture to perform such monitoring tasks. Just create one server application that will be used to aggregate information from clients. Next create one client application that will be used for collecting monitoring data and sending it to server. Then just deploy many client applications to your target machines and configure it to send all required information to server. Deploy one server application accordingly.
This architecture allows you to create your own security protocol for messaging between clients and server. You can choose the port your application will be communicate. Also you can create new/remove old clients without affecting other deployed applications (clients and server). Many existing popular monitoring systems (such as Zabbix) uses this architecture to perform system monitoring.
This eliminates need for configure remote connection to target machines. Client applications can use plain Process
class to gather all required data from operation system and then send it to server using i.e. HttpClient
. Also this architecture more appropriate for monitoring because there are some tasks that you can't perform by using remote connection.
xxx.xxx.xxx.xxx
without starting with `\`. – Fei Han