Run Remote Commands with SSH 1
By adding commands at the end of the ssh command they will be issued at the remote machine and you will get back stdout and stderr results on the local machine.
ssh useraccount@boxname 'someCommand | someOtherCommand'