Powershell – Automated Reboot Script – Schedule as a Task

ps  So I’m sure some of you are in smaller environments and don’t have a PC Management system in place (SCCM, Altiris, Etc).  I created a Powershell script that sends the command and also does error logging.  The results of the script are sent via SMTP.

In this case, I created a script that runs at 2am local time and created a scheduled task on the server to run the Powershell script.  The basic functionality is that it reads a Active Directory Group to get the Computer Names you would like to reboot.  It then attempts to send a Shutdown -R command to all machines.  It will keep track of the results and then send a HTML formatted E-Mail via SMTP.  Feel free to modify the code to save to a file if you would like instead.  This script uses Quest’s Powershell Active Roles commands.  I would recommend you down them also.

Download Link

HTML E-Mail with Results:

automatedreboot

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s