PowerShell Remoting Project Home

Monday, March 13, 2006

Securely Extend Monad Pipline over Network (2)

I have uploaded a testing binary package. You can download it from 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):
MonadServiceHost.exe 8888
Where "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.exe
3. 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-member
6. Connect client to remote server
$client.Connect()
7. Using client to communicate with server
# Ping Server
$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.
7. Disconnect client
$client.Close()
8. If something went wrong and you lost connection , just reconnect client
$client.Connect()


Have Fun!

Tags:    


Comments:

Post a Comment



Links to this post:

Create a Link



<< Home