Restart-Service
Powershell Script to Restart Services & Email
Reading Time: < 1 minuteSome servers, for one reason or another, need to have services restarted periodically. This script does just that, and has the ability to grab multiple service names using a wildcard populated array. After it’s complete, it sends an email from the script letting you know it’s complete. It’s commented out, but also has the ability to attach anything you’d like (eg. a command result output file) to the email as well.
It’s fairly simple, but it can be extremely helpful.
https://gallery.technet.microsoft.com/Restart-and-Email-Script-6f2dec66