WIN-003 · Script
Windows Service Health
Finds services that should be running but are stopped, and optionally restarts them.
Version 1.0.0Language PowerShellUpdated November 2026
What it does
By default, checks every service set to start automatically and reports any that are not running. Services that normally stop on their own (trigger-start and update services) are skipped. You can also pass a specific list of services to watch. In Fix mode it attempts to start each stopped service once.
Requirements
Windows PowerShell 5.1+, run as SYSTEM or local admin
How to run it
- Run as: SYSTEM or a local administrator
- Run from: any RMM or MDM, Intune, a Group Policy startup script, a scheduled task, or an elevated PowerShell window
- Script type: PowerShell, 64-bit
- User interaction: none; the script never prompts
- Timeout: 10 minutes (30 for Windows Update installs)
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| Mode | Report (default) or Fix. | Report, Fix | Report |
| ServiceNames | Optional list of service names to check. If empty, all automatic services are checked. | (none) | |
| ExcludeNames | Additional service names to ignore. | (none) |
Exit codes
- 0 = all healthy (or all restarted), 1 = stopped services remain, 2 = script error
Testing steps
- Run it first with the mode set to Report on one test device. Nothing is changed in that mode.
- Read the log and confirm the planned changes are what you expect.
- Run your chosen settings on the same test target and confirm the result.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Report mode changes nothing. Fix mode only starts services that are set to start automatically. To undo, stop the service in Services, or change its startup type.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |