the RDP protocol specifications do not have any support for executing remote commands, so there’s no easy way for this. We do have a feature called Key Sequence Tasks:
You can execute keyboard input on multiple sessions but it’s quite fragile as you can imagine. While the task runs, you shouldn’t interfere with your machine at all (switching away to other apps, for example) and you need to make sure that all sessions are “prepared” to take the keyboard input (like opening a command prompt in all sessions and make sure they have the keyboard focus).