Monday, March 13, 2006
1. Start MonadServiceHost.exe at Host Windows box with Monad installed (beta 3.1 for my testing):
MonadServiceHost.exe 8888Where "8888" is the port number you want server to listen. (Remember to allow accecc to local port 8888 in you firewall setting).
2. Start MSH.exe at client Windows box
MSH.exe3. Load MonadServiceClient.dll from within client MSH.exe
[System.Reflection.Assembly]::LoadFile("D:\MonadServiceClient.dll")where "D:\MonadServiceClient.dll" full path to MonadServiceClient.dll
4. Initialize a client object
$client = new-object MonadServiceClient.ClientLib (8888,"192.168.0.2")where "192.168.0.2" is the IP Address of Server, "8888" is port to connect .
5. Check out Method you can use
$client | get-member6. Connect client to remote server
$client.Connect()7. Using client to communicate with server
# Ping Server7. Disconnect client
# Invoke remote command
# run remote script
# Redirect output to a file if return a lot of objects.
$client.Close()8. If something went wrong and you lost connection , just reconnect client
Links to this post: