I am using Connect() and also a note that we need to change the agent extension to TCP/IP.
Now I am able to run my scripts in a remote machine.
I have an agent rnning in my machine and the remote one.
I want to know is it my agent or the agent in that machine that actually does the work?
If I remove either of the agent it does not work.
You do need both agents to run remote scripts. The system that starts the script needs to maintain a connection to the remote system to send the commands in the script to the remote system. It does not send the entire script but a command at a time. Once the commands are sent to the remote system that agent carries out the commands.