i have a piece of code which i want to execute on remote computer. I am not getting how to do that. Like if i want to execute command given below on remote machine how to do that.
Process[] processlist = Process.GetProcesses();
it is just an example, like i want to execute whole code on remote machine with libraries.
if you are going to answer for getting processlist as
SelectQuery selectQuery = new SelectQuery("Select * from Win32_Process");
using(ManagementObjectSearcher searcher =new ManagementObjectSearcher(manScope, selectQuery))
i already know that , please save it. is there any way to execute whole code after connecting to scope.
for getting list of process on remote machine just enter name of remote machine in brackests..
Process[] processlist = Process.GetProcesses(Remotemachine);
for reference: https://msdn.microsoft.com/en-us/library/1f3ys1f9%28v=vs.110%29.aspx
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments