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

Remote Desktop: Broken Domain Trust Relationship Between Workstation an Primary Domain Controller

Symptom Remote desktop initiation toward a certain server would result in an error message with…

How to Change a Disk Signature using Diskpart

Application: to potentially resolve issues with duplicate disk signature in a Windows Virtual Machine Symptom:…

How To Reset Administrator Password – HP iLO Versions 2-4

Prelude: this instruction only works on HP iLO versions 2 to 4; hence, the title…
Other project: DragonCoin.com