Avatar of Cobra25
Cobra25
 asked on

Script to restart service

Hi Guys,

I need a script that will restart a specific service every 12 hours for server 2008 r2.
Windows Server 2008Scripting LanguagesMicrosoft Server OS

Avatar of undefined
Last Comment
Will Szymkowski

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
jerseysam

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Will Szymkowski

You can do this vary easily with powershell...
See the below example...

restart-service -Name BITS

Open in new window


Save the script as Restart.ps1

Launch a Powershell Script from Task Scheduler
http://blogs.technet.com/b/heyscriptingguy/archive/2012/08/11/weekend-scripter-use-the-windows-task-scheduler-to-run-a-windows-powershell-script.aspx

Will.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23