Running Commands on Remote Workstations

I want to run the command “gpupdate” on all the worstations of the domain…
What is the easiest way to do it…

Re: Running Commands on Remote Workstations

If you have admin priveledges you can schedule the command to run at a specific time, using the "winat.exe" or "at" utility. There's another one called "soon.exe" that comes with the windows resrouce kit which schedules the command at the soonest possible minute (otherwise you have to check the exact time on the remote workstation.

Ofcourse you can always:
- telnet to the server and run it
- take a walk to the workstation
- email the dude who owns the pc to run the command
- use Dameware
- use Subseven or any other remote control utility, also VNC
- RDP or TermSvc
- etc etc

If i think of more I'll let u know.

Re: Running Commands on Remote Workstations

I don't know about your platform, but in our environment we have machines running XWindows clients on top of MS Windows 2000/XP. We have the option of using Rsh (remote shell) and Rexec (remote execute) to run commands on remote machines with XWindows client running. I think we can make a script to run in a loop to execute the same command on multiple machines.

Re: Running Commands on Remote Workstations

what TB said is just perfect.

I think it can be done using logon and startup scripts..

Re: Running Commands on Remote Workstations

:clap:Thanks all

I tried winat and soon…
both do the job well

for now, i only needed to run a commands on one remote pc in domain without using telnet… so soon.exe and winat.exe worked great… [the copy/paste feature of jobs is cool in winat] i wish winat had an option to select all domain PCs rather than one at a time… like “shutdown -i” command, where u can browse and select as many workstations as u want.. so you could run the command on all PCs with a mouse click.

TofiBhai, can u elaborate on “telnet to the server and run it” .. That would only run the command on the selected server rite ?

Re: Running Commands on Remote Workstations

You can install a telnet daemon on that pc and then when u telnet in u can use all the DOS commands that you can use locally. Hence the telnet DOS window would be like opening up cmd window locally.

With soon you can schedule jobs on multiple PC's via a batch file. For instance if you put all the PC names in a txt file, and then call the file and pick up each PC name and run in a loop with the "for /f" command. Here's what the batch would look like:


for /f %%a in comp.txt do (soon %%a gpupdate)

exit

And your comp.txt file would be:
pc1
pc2
pc3

Its a very very basic way to it but it should work. You can add error handling and loggin etc in it but that's for the next lesson. Hope that helps.

Re: Running Commands on Remote Workstations

^thanks so much, i will try that tomorrow

Re: Running Commands on Remote Workstations

ow woww... that batch thing goes fast...

thanks tofi... i will remember u everytime i make a batch file :)

Re: Running Commands on Remote Workstations

:D Glad to be of service! Yeah, its fast, that's why its so much fun. Just test it out first to see if the update things were scheduled properly. I just typed it in without testing.

It was a batch file like this when I fell in love with batch files. There's tons of utilities out there that help regular batches. Have fun with them.

Re: Running Commands on Remote Workstations

yah... there r many samples on the web... big world of batch scripting out there
its simple programming too... i was hesitant at first... but its all dos.... i hope i can call myself a programmer now :P

utilities hmmmmm.... i will search for them... plz post ur favs or the ones u know.. thanks...