You can execute the same command simultaneously on multiple computers using PSEXEC.EXE from Microsoft's SysInternals toolkit. To run a command on multiple remote computers:
- Create the text file
PCNAMES.TXT
- Put the remote computer names in the text file, one per line
- Run PSEXEC.EXE using the following syntax:
PSEXEC.EXE @PCNAMES.TXT -s Command_To_Run.exe
This will run Command_To_Run.exe
in the context of the remote computer's SYSTEM account and it assumes the executable is in the system path on the remote machine.
PSEXEC command line options relevant to your situation:
-c Copy the specified program to the remote system for execution. If you omit this
option the application must be in the system path on the remote system.
-d Don't wait for process to terminate (non-interactive).
-u Specifies optional user name for login to remote computer.
-p Specifies optional password for user name. If you omit this you will be prompted
to enter a hidden password.
-s Run the remote process in the System account. The remote command will only
have access to local resources on the remote computer.
Examples:
Copy Command_To_Run.exe
from your local computer to the remote PC (-c
switch) then execute it there:
PSEXEC.EXE @PCNAMES.TXT -c Command_To_Run.exe
Use a different user account/password (-u
and -p
switches) to run the remote command. Useful when accessing network resources from the remote PC:
PSEXEC.EXE @PCNAMES.TXT -u UserName -p Password Command_To_Run.exe
Questions: 1) Do I correctly assume the list of computers you're remotely connected to could be different at any given time? 2) Would you be able to come up with a list of the computers to which you wanted to send the command without involving the RDP Manager? – I say Reinstate Monica – 2015-06-08T17:30:23.633
Yes, the computers could be different. And Yes, I could generate a list of computers that I wanted the command send to. – David – 2015-06-08T17:41:20.763
Are the computers on the same LAN or on different networks? Also, do you have Administrative level access to the computers? – I say Reinstate Monica – 2015-06-08T17:44:51.820
They are on the same domain, on the same LAN, and yes, I would be logged in as domain admin. – David – 2015-06-08T17:48:20.077