Merry Christmas & Happy 2027! Less downtime. More good times. Celebrating 13 years of sorlavit.com
Skip to content
Sorlavit KimIT Support, Network & Infrastructure Services Let’s talk

Articles are written in English. The Thai translation button opens Google Translate; code and commands stay in their original form.

Windows Commands / IT Support Guides

Read recent Windows errors with Get-WinEvent

Find recent errors in the Windows System event log and match them to the time a problem began.

Compiled for Sorlavit Kim · Published · Updated · 1 min read

Environment and inputs: Windows 11 · Command Prompt unless PowerShell is specified

Understand the problem

Run PowerShell on the affected Windows computer. Note the time the problem started and check that your account can read the System log.

Run the command

The displayed command selects Error events (Level 2) from the last two hours and returns up to 20. Change the time window if the problem happened earlier.

Get-WinEvent -FilterHashtable @{LogName='System'; Level=2; StartTime=(Get-Date).AddHours(-2)} -MaxEvents 20 | Select-Object TimeCreated, Id, ProviderName, Message

Read the output

Start with TimeCreated and ProviderName. An event ID has meaning in the context of its provider, so record both. Read Message for the details of that occurrence.

Choose the next step

If no entries match, confirm the time window and log name. An application may write to the Application log or to its own log. A warning or critical event can also fall outside this filter.

Before making changes

Keep the timestamp, provider and event ID when sharing a finding. Review the message for sensitive values before sending it.

Source & further reading

Microsoft Learn — get-winevent

Independently written summary reviewed on 2026-11-01. The example illustrates a possible application; it is not a client case study.

Share this article

Back to all articles