reboot PCs via Group Policy

TJESIOLOWSKI
TJESIOLOWSKI used Ask the Experts™
on
Hello -

I've got about 100 PCs and would like to reboot them on a schedule of once a week. What is the best way to do this through Group Policy? Can I write a batch file with the shutdown -r command and somehow tie it to scheduled tasks? Do I need to script out the scheduled task part along with the shutdown command?

Any help would be greatly appreciated..
Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Todd GerbertSenior Engineer
Top Expert 2010

Commented:
I think SysInternals has a utility you can use to shutdown computers, http://www.sysinternals.com/, that will take a list of computers in an input file and reboot'em all. Then you can schedule just one task on a server.
Senior Systems Admin
Top Expert 2010
Commented:
You can't do this through a GPO, but I can give you a process for it. You'll need to download PSTools from here: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
Exctract it to a directory that's easy to get to (like C:\Shutdowns or something like that.)
Leave that aside for now.
Run the following command on as an administrator on any Server:
csvde -f c:\computers.csv -r "(objectclass=computer)" -l name

This will build a CSV file that has all of the computers on your network in it. Open this file in Excel, remove the first column (the on with the heading of DN and that has LDAP strings in it) This will leave the CSV file with just the computer names in it. Look through this file and find any computer names that you *don't* want to have reset. Save the resulting file as a .csv file in the same folder you extracted pstools to. Set up a scheduled task that will run the attached code at the time you want, using the administrative account. You may need to fiddle with the @file section. I can't remember if its @file <filename> or @<filename> And I don't have access to a good test environment at the moment.
psexec @file computers.csv shutdown -r

Open in new window

Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Adam BrownSenior Systems Admin
Top Expert 2010

Commented:
Sorry, forgot to mention that you'll need to erase the entries in the csv file for computers you don't want to reboot.
Adam BrownSenior Systems Admin
Top Expert 2010

Commented:
The utility mentioned by tgerbert is psshutdown and it will come with the download for psexec. The command for that is psshutdown @file computers.csv -u domain\user -r (doing this will prompt you for a password. The user you use has to have the right to shut down the system.)
Along with the SysInternals way, you can also make a batch script that holds a list of shutdown commands using the built-in shutdown command:

shutdown /m \\Computer1 /r
shutdown /m \\Computer2 /r
shutdown /m \\Computer3 /r

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial