Windows Server 2003
1830192 Members
5044 Online
109999 Solutions
New Discussion

Pushing batch scripts across AD

 
Aaron.S
Frequent Advisor

Pushing batch scripts across AD

Hi,

I'm in a bit of a pickle and would really appreciate some help.

I'm trying to deploy a batch script across ~100 servers. The problem is if I set the batch script as a startup / logon script, then I have to restart all the computers manually (not an option because of what the servers are used for), or to log in to each system manually (which defeats the purpose of using a script).


As I understand it, I have to somehow convert the batch file into an .msi file to push it out.

OR

To configure some sort of scheduled task in the AD to run the batch script across all systems.


My dilema is I can't solve either of these problems.

Any help or feedback is greatly appreciated.


-Aaron
3 REPLIES 3
Rune J. Winje
Honored Contributor

Re: Pushing batch scripts across AD

Hi,
perhaps of help:

http://www.windowsnetworking.com/articles_tutorials/Managing-Windows-Networks-Using-Scripting.html

A scriptable command to do remote shutdown/restarts of servers - via a batch file for example - would be to use the shutdown command
http://www.online-tech-tips.com/computer-tips/remote-shutdown-command/

But all depends a bit on exactly what task you have in mind. Sometimes you will need more advanced options to make your admin life easier with either Microsoft's http://www.microsoft.com/SMServer/default.mspx or 3.rd party products like http://www.snowsoftware.com/website1/1.0.1.0/53/2/index.php


Cheers,
Rune
Gfuss
Trusted Contributor

Re: Pushing batch scripts across AD

Aaron,
Along with the links above, I find PSTools (now Microsoft, formerly SysInternals) very useful. You can check out the suite here:

http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx

One of my favorites is psexec, which allow you to remotely execute programs on the destination server/computer. This can be used to open a remote CMD prompt on the server in question, issue your commands (e.g. netsh to change the IP) and exit.

You could encorporate these utilities into a batch file that is executed locally and the changes are made over the network via psexec.

Let me know how it goes.

-Gfuss


Peeky1323
Occasional Advisor

Re: Pushing batch scripts across AD

Also depending on what you need to do you could use the "AT" command to remotely create a scehduled task on the servers in question:

http://support.microsoft.com/kb/313565