Posted On March 31, 2019

Quick and Dirty Script to Watch and Start / Restart Windows Service

kimconnect 0 comments
blog.KimConnect.com >> Windows >> Quick and Dirty Script to Watch and Start / Restart Windows Service
// powershell.exe
// -ExecutionPolicy Bypass c:\scripts\serviceCheck.ps1
$serviceName = '[input-service-name-here]'
$arrService = Get-Service -Name $serviceName
while ($arrService.Status -ne 'Running')
{
Start-Service $serviceName
$arrService.Refresh()
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Windows Time Service Configuration

Update 12/27/2019: use this script to set Windows time automatically    It has been a…

Upgrade from Windows 2008 R2 to 2012 R2

1. Run: f:\support\adprep\adprep /forestprep f:\support\adprep\adprep /domainprep   2. Start Windows setup to upgrade the OS…

How to Cramp For a Test

From my experience, the trick to memorizing 10,000+ questions and answers at the 90% accuracy…