Monday, May 07, 2012 2:40 PM
I need a way of shutdown my windows 7 computers in my 2003 server domain.
i need that shutdown to occur daily and automatically without user input.
i would perfer not to have the server issue the command everytime, but a way of the windows 7 computer know they need to shutdown.
i also need to be able to have it sent out from the server as i have over 600 desktops.
There is no chance of upgrading to 2008.
Monday, May 07, 2012 3:21 PM
you already post in general, Please avoid for duplicate :http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/49569229-9424-4a45-9846-b622147fb8b6
You can also use shutdown command plus Scheduled Tasks, here are detailed steps:
1. Create a batch file called downtime.bat using notepad.
2. Add this line in the batch: shutdown -s -f -t 30 (note: -s = Shutdown, -f = Forces running applications to close without warning, -t 30 = Set timeout for shutdown to 30 seconds) and save the downtime.bat at C drive.
3. Open Scheduled Tasks by going to Start>All Programs>Accessories>System Tools.
4. Click Add Scheduled Tasks.
5. Browse the downtime.bat from C drive.
6. Follow the screen to setup the day and time.
7. Assign a user who has administrator rights and finish the settings.
Note: The shutdown options may different deepening on the version of the shutdown command.
In the meantime, you can deploy schedule task via group policy using startup script which has schedule task command to shutdown system, please refer to:
schtasks /create /sc daily /tn shutdown /ru "NT AUTHORITY\SYSTEM" /tr "c:\windows\system32\shutdown.exe /s /t 120 /c "Nightly_Shutdown" /f" /st time
Please customize these commands according to your situation. For more information on creating a task via command, please type “schtasks /create /?’
To deploy a script via group policy, go to Computer Configuration, Windows Settings, Scripts(Startup/Shutdown).
You can use the following script as a scheduled task:
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
strWarning = "Due to system maintenance, this computer must be restarted. You have 5 minutes to save your work from the start of this countdown."
strDelay = 300
Set oTS = oFS.OpenTextFile("C:\Computer.txt")
Do Until oTS.AtEndOfStream
strCompname = oTS.ReadLine
WshShell.Run "C:\Windows\System32\shutdown.exe -m \\" & strCompname & " -r -c " & Chr(34) & strWarning & Chr(34) & " -t " & strDelay
'close the text file
Where Computer.txt is a text file containing the name of the computers to restart. I found this script one day in a forum thread and I wanted to share it with you.
Note that by running it, users of computers to restart will be notified that a restart will occur after 5 minutes.
Ref. threads -
Mohammed Imtiyaz Ali
- Marked As Answer by itschools Monday, May 07, 2012 6:41 PM