|
Monday, March 13, 2006
Securely Extend Monad Pipline over Network (2)
gotdotnet. If you have any suggestions or bug reports, please drop a few lines as comment.
Usage:
1. Start MonadServiceHost.exe at Host Windows box with Monad installed (beta 3.1 for my testing):
2. Start MSH.exe at client Windows box
4. Initialize a client object
5. Check out Method you can use
Have Fun!
I have uploaded a testing binary package. You can download it from
Usage:
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
$client.Ping()
# Invoke remote command
$client.Invoke("get-process")
$client.Invoke("set-location HKLM:")
# run remote script
$client.Invoke("D:\msh\id.msh")
# 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
$client.Connect()
Have Fun!
Post a Comment