Solved

Need help creating/implementing a GPO to reboot computers nightly

Posted on 2009-04-02
5
724 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

770 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