Hello and welcome to the board.
Here is some code to get you started. Code is untested so don't just run it as is, but review it and change as needed.
The Remote execute is not in the script but I've given you a link and you can search the board as well for other examples.