Running a Script on Active Directory Domain Member PCs without Reboot or Logon

active-directoryscripting

I have an Active Directory domain running on Windows Server 2003 R2. Clients are a mixture of Windows XP SP2, Vista, and Windows 7. I want to run a script (batch file, but possibly a VB script) on each machine, once. I don't want this to happen on Logon, Logoff, Startup, or Shutdown. I just want it to happen as soon as possible, and once.

Is there a relatively painless way to do this that will work across all the client types?

Thanks.

UPDATE: I should have mentioned this originally: Many of the PCs are behind cheap 5-port routers plugged into an ethernet jack. Think five grad students sharing an office. So each PC in an office has an RFC1918 IP. I'm on the public side of the router, so I can't connect directly to the PC. Hence PsExec or WMI won't work. WinRM might, but most of the PCs don't have that installed. I think my only option is to use a GPO somehow, maybe to schedule a task to run a script from a network drive.

Best Answer

I would say use psTools psexec.exe to remotely run the script.

It's a painless process to get up and running, doesn't need you to log into every station, and doesn't leave a footprint after-wards.


In response to all the comments, since they can talk to the DC's to be on the domain, you should be able to jump onto a DC and run the psexec script from there.