Using Specops Command Scripts to Restart Multiple Services

Specops Command is a great product bringing the power of PowerShell into Group Policy allowing admins to create pretty much any script and deploy it with Specops Command.
While playing around with my demo environment lately I decided to write a little script to ensure all services associated with the demo be started at all times and if they weren't then start them and report the status to the Specops Reporting Database. Here's the result.

____________________________________________________________________________
$computername = $env:computername
Get-Service -DisplayName "*Specops*" | %{
if ($_.Status -eq "Stopped" ){
Start-Service -ServiceName $_.Name
}
}
send-feedback "Sucessfully started the Specops Services on $computername"
____________________________________________________________________________


Can be used with Specops Command which is available for download from http://www.specopssoft.com/products/specops-command

Enjoy Folks

0 comments: