Sub topic 2
Reading Event Viewer and system logs
This chapter assumes you know basic Windows navigation, can open an elevated Command Prompt or PowerShell, and understand the troubleshooting methodology from the previous chapter. Event Viewer is where you gather evidence during the "establish a theory" step, before you change anything.
What Event Viewer records
Event Viewer (eventvwr.msc) shows logs that Windows and applications write as things happen. Each entry is an event with a time, a source, an ID, and a level.
The logs you need for the exam are under Windows Logs:
| Log | What it holds | Typical use |
|---|---|---|
| Application | Events from installed programs | Application crashes, faulting modules |
| System | Events from Windows components, drivers and services | Service failures, driver errors, unexpected shutdowns |
| Security | Audit events such as logons and failed logons | Failed sign-ins, access auditing |
| Setup | Events from installs and updates | Failed updates |
Each event has a level: Information, Warning, Error or Critical. Start with Error and Critical, then look at Warnings near the same time.
A workflow for reading logs
- Note when the problem happened. A rough time is enough.
- Open the log that matches the symptom. Use Application for a crashing program and System for a failed service or driver.
- Choose Filter Current Log and select Critical and Error. Narrow the time range.
- Select an event and read the General tab. Note the source, the event ID, and any faulting module or service name.
- Look for the earliest error in a cluster. Later errors are often side effects of the first one.
- Search the source and event ID, then form a theory and test it.
Reading logs from PowerShell
Event Viewer is a graphical tool, so you can also query logs from the command line. This is useful on a remote or headless machine. This command lists the ten most recent Application log errors from the past day.
Get-WinEvent -FilterHashtable @{ LogName = 'Application'; Level = 2; StartTime = (Get-Date).AddDays(-1) } | Select-Object -First 10 TimeCreated, ProviderName, Id, MessageLevel = 2 means Error. Use Level = 1 for Critical and 3 for Warning. Change LogName to System to look at drivers and services.
Common clues
- Event ID 41 (Kernel-Power) in the System log means the system restarted without a clean shutdown. Look for a stop error or a power problem.
- Service Control Manager errors in the System log show a service that failed or timed out at startup.
- Application Error and Application Hang entries in the Application log name the faulting program and module.
- Event ID 4625 in the Security log records a failed logon.
You do not need to memorize many IDs for the exam. You do need to know which log to open for a given symptom.
Exercise
A user says a program closed unexpectedly about ten minutes ago. Which Event Viewer log do you open first, which levels do you filter for, and what information in the event helps you find the cause?
Show answer
Open the Application log, filter for Error and Critical around the time of the crash, and read the General tab for the faulting application and faulting module name. That points toward a bad add-in, library or driver to investigate.
Exercise
A computer restarted by itself overnight. The System log shows a Kernel-Power event with ID 41. What does it tell you, and what should you look for next?
Show answer
It shows the system restarted without shutting down cleanly. Look at the System log just before it for a stop error, driver error or hardware fault, and check for power or overheating problems.