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

Increase memory allowance for WMI

Run: wbemtest.exe >> click Connect >> Namespace = root >> Connect >> click Enum Instances…

Block USB in Windows 7 using Group Policy

Create and assign a group policy to the appropriate OU with this configuration: Computer Configuration…

Fix Missing User Special Folders

1. create C:\Users\KimConnect\Pictures 2. Regedit >> HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders >> modify "My Pictures" value to…