PowerShell Services
Find services that need investigation without treating every stopped service as a failure.
Documentation: Microsoft Learn
Overview
A stopped service is not automatically an incident. Some services start on demand, some are disabled intentionally, and some stop when their work finishes. Begin with the service the application depends on and its expected state.
The example lists stopped services with their names, display names and startup types. The short Name is useful for subsequent commands; DisplayName is intended for people. StartType tells you how startup is configured, not whether the application is currently healthy.
In the browser dataset, WinRM is stopped and configured for manual startup. That observation alone does not justify starting it. First establish whether this machine is meant to accept remote administration.
On a real system, correlate service state with application logs, dependencies and a health check. If a restart is justified, define how you will verify recovery and what evidence to collect before the restart removes the immediate symptom.
See the objects move
Inspect this authored example with fictional data in the bounded browser model. The numbered stages show how its objects change.
Get-Service | Where-Object Status -eq 'Stopped' | Select-Object Name- Stage 1Get-Service
Positional values or no named parameters - Stage 2Where-Object
-eq - Stage 3Select-Object
Positional values or no named parameters
What happens
Run the stopped-service query. Change the condition to Running and compare the output. Try selecting only Name and Status, then explain what context you lose by removing StartType.
Worth remembering
Service state answers one question. Application health, startup policy and dependency availability need separate checks.
Primary documentation
Try it
Browser simulation · fictional data; no changes to your computer.
Your task: Return only the stopped service names. Keep Name in the result. Explain why this list alone does not prove those services should be started.
Follow the objects
Run the command to inspect each stage.
Hint
Filter on Status before selecting Name.
Compare a solution
Get-Service | Where-Object Status -eq 'Stopped' | Select-Object NameFinds automatic services that are not running.
Show reference output
Sample output · fictional data, shaped like the real thing
Name DisplayName StartType ----- ------------------------- --------- WinRM Windows Remote Management Manual
Practise this
Find stopped automatic services
Return Name and StartType for stopped services with StartType Automatic.
The sandbox is visible now. Sign in with Google only when you run or check a task; commands and temporary files are discarded when you leave.
Run a command to inspect its result.