Solved

Need help creating/implementing a GPO to reboot computers nightly

Posted on 2009-04-02
5
728 Views
Last Modified: 2012-05-06
We have gone to a new antivirus product and some of our domain computers are drastically slower first thing in the morning.  The scans run automatically every night.  Rebooting seems to cure the issue.  Can someone help with instructions on how to create and implement, or add to the existing GPO, an object to reboot the computers automatically every night after virus scans finish?  If there is an easier way than a GPO, I am open to suggestions.
0
Comment
Question by:rstorm1
5 Comments
 
LVL 47

Expert Comment

by:Donald Stewart
ID: 24051138
Use psshutdown
 
https://technet.microsoft.com/en-us/sysinternals/bb897541.aspx 
Create a list of the servers you need to reboot in a .txt one per line
create a scheduled task with this in the "Run"  psshutdown @\\server\share\servers.txt -accepteula -r -f -c -t 120
0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 500 total points
ID: 24051153
You can do this using a combination of the schtasks and shutdown commands.

If all of your computers are up and running on the network then you could make a list of their names in a text file and then run a command like this to create a scheduled task on all of them at once:
for /F %G in (computerlist.txt) do schtasks /Create /S %G /RU "NT AUTHORITY\SYSTEM" /SC DAILY /ST 02:00:00 /TN NightlyReboot /TR "shutdown -r -f -t 600"

Otherwise you could create a batch script in the group policy node Computer Configuration\Windows Settings\Scripts\Startup which runs this command:
schtasks /Create /RU "NT AUTHORITY\SYSTEM" /SC DAILY /ST 02:00:00 /TN NightlyReboot /TR "shutdown -r -f -t 600"

This will create the scheduled task on each affected machine at every startup.  Running the script when the task is already there will not cause a problem.
0
 
LVL 4

Author Comment

by:rstorm1
ID: 24051249
Thanks, will test as soon as possible.
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 24053892
can you tell what is the antivirus ? does the name start with a "f-" ? :)
0
 
LVL 4

Author Closing Comment

by:rstorm1
ID: 31565839
Went with the batch script in GPO.  Seems like that is going to be the ticket.
0

Featured Post

Don't miss ATEN at NAB Show April 24-27!

Visit ATEN at NAB Show to learn how our "Seamlessly Entertaining" solutions deliver fast, precise video streaming without delays for the broadcasting and media environment. ATEN will showcase its 16x16 Modular Matrix Switch (VM1600) and KVM Over IP Solution (KE6900 series).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question