Applies to: Windows Server 2019, 2022 and 2025.
Service recovery can restart a failed service, but repeated restarts may hide a fault or worsen corrupted state.
Monitoring should collect enough evidence to diagnose trends without overwhelming storage or exposing sensitive logs. Visit managed Windows VPS hosting.
Prerequisites
- Confirm vendor supports restart.
- Identify dependencies.
- Choose thresholds.
- Enable alerting.
Procedure
Step 1: Inspect service
Read state and dependencies.
Get-Service Spooler | Format-List *Step 2: Capture current recovery
Save baseline.
sc.exe qfailure SpoolerStep 3: Configure recovery
Set two restart attempts.
sc.exe failure Spooler reset= 86400 actions= restart/60000/restart/60000/none/0Step 4: Test
Use a vendor-approved unexpected-failure test in an isolated environment; a normal service stop is not equivalent to a crash.
Step 5: Monitor events
Watch 7031 and 7034.
Verification
Query recovery and recent events.
sc.exe qfailure Spooler
Get-WinEvent -FilterHashtable @{LogName='System';Id=7031,7034;StartTime=(Get-Date).AddHours(-2)}Rollback
Restore the recorded recovery settings or configure take-no-action during investigation.
Operational notes
Use the real business service; Spooler is only an example.
Test a real failure, not a normal stop
A normal administrative Stop-Service operation generally does not simulate an unexpected service failure and may not trigger the configured recovery action. The original recovery test must therefore use a vendor-approved failure scenario in a disposable or isolated environment. Do not terminate a production process merely to see whether Windows restarts it.
Check how the service reports failures to the Service Control Manager and whether its configured failure behaviour includes non-crash errors. A dependency failure, a controlled application exit and a worker-process crash can produce different results. Record the recovery sequence and the event that actually triggered it.
Choose delays long enough for a dependency or network resource to recover. Limit repeated automatic attempts and alert an operator if the service keeps failing; an endless restart loop can consume resources or repeat a damaging transaction. A service that briefly reaches Running can still be unhealthy from a user’s point of view.
After the controlled test, verify application-level health and recent System events. Preserve the previous recovery policy before changing it, and restore that exact policy if the new behaviour makes diagnosis harder. The sample Spooler identity is an example, not advice to alter print services on every server.
Official references
For a hosted environment with setup and onboarding, explore our managed Windows VPS plans.