You can use the run-on-all script to run a command on multiple remote targets. This script runs a command on a set of remote hosts. The output from all targets is displayed. Note that this uses the "jcs:execute()" function, so the user must set up ssh-agent and keys as needed to allow unprompted login.
See the document run-on-all