Shutdown Script for Active Directory - Domian Group Policy

Our company is using windows 2003 server and active directory. I need to create a script that shuts down all our computers except for the server at 8PM every night.  I would like to apply this a group policy for the domain. What is the best way to do this and what script should I use. .I should add I have no skills in writing scripts. Thank you in advance.
surf4evrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:
Have a list of computers?  This will do it..

For /f %%a in (C:\Computers.txt) do schtasks /s %%a /create /ru system /sc daily /st 20:00:00 /tn Shutdown /tr "shutdown -s -f -t 10"

It'll loop through all systems setting up a scheduled task to shut them down at 8pm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
durgeCommented:
I've turned this into an easily editable batch script, the source code is here. If you wish to comment on where I originally posted this, here is the link.

http://bbs.dontassrape.us/viewtopic.php?id=295
@echo off
REM Variables - CHANGE THESE TO SUIT YOUR NEEDS
 
REM The list of computers that will be read, one line per computer in the text file!
Set ListFile=ITsuitePClist.txt
 
REM The name of the log file to write to.
Set LogFile=deploylog.txt
 
REM The shutdown time, must be 24 hours in the same format as below.
Set ShutdownAt=18:30:00
 
REM The shutdown timeout, how long the computer waits before it shuts down.
Set ShutdownTimeOut=10
 
REM The name of the task, this will appear in Scheduled Tasks on the workstations, a good idea not to use spaces.
Set TaskName=EveShutdown
 
 
REM Dont touch below ;)
 
title Network Shutdown Deploy - Stage 1 (using list file: %ListFile%)
echo.
echo.About to deploy shutdown scheduled task, using file %ListFile%
echo.
echo.Press any key to review the computers being deployed to...
pause >nul
title Network Shutdown Deploy - Stage 2 (using list file: %ListFile%)
echo.Contents of list file:
echo.
echo.START OF LIST
echo.
type %ListFile% |more
echo.
echo.END OF LIST
echo.
echo.Press any key to begin the deploy (CTRL+C to abort now)...
pause >nul
title Network Shutdown Deploy - Stage 3 (using list file: %ListFile%)
echo.
echo.Deploying, See %LogFile% for deploy messages.
echo.
echo.(if you dont see any activity it probably means the task already exists, Press Y to replace the task continually, you will eventually get to the Complete stage)
echo.
echo. >> %LogFile%
echo.BEGIN - Shutdown Deploy Log For %time% - %date% >> %LogFile%
echo. >> %LogFile%
For /f %%a in (%ListFile%) do schtasks /s %%a /create /ru system /sc daily /st %ShutdownAt% /tn %TaskName% /tr "shutdown -s -f -t %ShutdownTimeOut%" >> %LogFile%
echo. >> %LogFile%
echo.END - Shutdown Deploy Log For %time% - %date% >> %LogFile%
title Network Shutdown Deploy - Stage 4 - COMPLETE! (using list file: %ListFile%)
echo.
echo.Complete, See %LogFile% for deploy messages.
echo.
echo.Press any key to exit.
pause >nul
exit

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.