Windows Services
Cheat sheet · https://pcornel.dk/topic.php?topic=377
Answer
Windows Services explains long-running or event-triggered background workloads managed through the Service Control Manager (SCM). The SCM maintains installed-service configuration and controls service start/stop/status; a service can run without an interactive user logon and can execute under a dedicated service identity.
Remember
- Installed service ≠ running service ≠ healthy application function.
- Startup type controls how a service may be started; it is not the same as current runtime state.
- A service account defines security context and network/local rights available to the service process.
- Dependencies affect start/order relationships but do not automatically prove dependency health.
- One process can host one or multiple services, so service identity and PID must both be checked.
First checks
Get-Service <name> | fl *— status, start type, dependenciesGet-CimInstance Win32_Service -Filter "Name='<name>'" | Select StartName,PathName,StartMode— account, path and modesc.exe qc <name>— configuration in CMDGet-WinEvent -FilterHashtable @{LogName='System';ProviderName='Service Control Manager'} -MaxEvents 20— SCM events
Commands
sc.exe qc <service>- Shows a service's configuration: start type, binary path, dependencies and the account it runs as.
sc.exe query <service>- Shows the state of a Windows service: running, stopped or pending, and its exit code.
services.msc- Opens the Windows Services management console, a GUI for querying installed services and—subject to rights—starting, st…
sc.exe- Windows command-line service control/configuration utility that maps to Service Control Manager functions. It can query…
Start-Service- PowerShell cmdlet that sends a start request for one or more Windows services. It changes service lifecycle state and s…
Stop-Service- PowerShell cmdlet that requests one or more Windows services to stop. It is a state-changing control action whose depen…
Get-Service- PowerShell cmdlet that gets Windows service objects and their SCM-reported status. It is a read-oriented starting point…
Verify in this order
SCM reads config → starts dependencies → starts the service under its account → Running
Where it usually breaks
First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.
Windows Services reference map
| Item | Meaning | Evidence boundary |
|---|---|---|
| SCM configuration | Installed service record | name, binary, start type, account, dependencies |
| Runtime state | Stopped/Start Pending/Running/etc. | lifecycle status reported to SCM |
| Service process | Executable/PID | runtime container; may host multiple services |
| Service account | Security identity | local/network access context |
| Application health | Actual provided function | must be tested beyond service RUNNING state |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=377