Required Files: None
Adapts my ServiceMonitor script to check for critical services that need to be running for QuickBooks POS software. Note, the entitlement, database, and update service names are version specific; you may need to check this to be sure you aren’t running a different version than the computer that I modeled to create this script.
Import-Module $env:SyncroModule <# .SYNOPSIS Adapts my ServiceMonitor script to check for critical services that need to be running for QuickBooks POS software. .DESCRIPTION Checks the status of the critical services, and optionally starts the services and/or creates a Syncro alert if they were not already running. #> <# Set your run options below. Specify whether or not you want to start it if it's stopped and/or alert if it's stopped. #> $startIfStopped = "true" $alertIfStopped = "true" <# If alertIfStopped is true, then set the category below. #> $alertCategory = "QuickBooks_Service" <# The entitlement service may be version specific - edit the service name below if necessary. #> $entitlementServiceName = "Intuit Entitlement Service v8" $updateServiceName = "Intuit Update Service v4" $databaseServiceName = "QBPOS Database Manager v11" <# Nothing below here requires editing. #> $service = Get-Service -Name $entitlementServiceName $stat = $service.Status if ($stat -ne "Running") { if ($startIfStopped -eq "true") { Start-Service $serviceName if ($alertIfStopped -eq "true") { $stat = $service.Status Rmm-Alert -Category $alertCategory -Body "$serviceName was stopped. Attempted to start it. Current status is: $stat" } }else { Rmm-Alert -Category $alertCategory -Body "Warning! $serviceName was stopped. Was not set to start it... the current status is: $stat" } } $service = Get-Service -Name $updateServiceName $stat = $service.Status if ($stat -ne "Running") { if ($startIfStopped -eq "true") { Start-Service $serviceName if ($alertIfStopped -eq "true") { $stat = $service.Status Rmm-Alert -Category $alertCategory -Body "$serviceName was stopped. Attempted to start it. Current status is: $stat" } }else { Rmm-Alert -Category $alertCategory -Body "Warning! $serviceName was stopped. Was not set to start it... the current status is: $stat" } } $service = Get-Service -Name "QBCFMonitorService" $stat = $service.Status if ($stat -ne "Running") { if ($startIfStopped -eq "true") { Start-Service $serviceName if ($alertIfStopped -eq "true") { $stat = $service.Status Rmm-Alert -Category $alertCategory -Body "$serviceName was stopped. Attempted to start it. Current status is: $stat" } }else { Rmm-Alert -Category $alertCategory -Body "Warning! $serviceName was stopped. Was not set to start it... the current status is: $stat" } } $service = Get-Service -Name $databaseServiceName $stat = $service.Status if ($stat -ne "Running") { if ($startIfStopped -eq "true") { Start-Service $serviceName if ($alertIfStopped -eq "true") { $stat = $service.Status Rmm-Alert -Category $alertCategory -Body "$serviceName was stopped. Attempted to start it. Current status is: $stat" } }else { Rmm-Alert -Category $alertCategory -Body "Warning! $serviceName was stopped. Was not set to start it... the current status is: $stat" } } |