How To Read And Filter Windows Update Log In Command Line – POFTUT

How To Read And Filter Windows Update Log In Command Line


Windows operating systems updates generally done automatically and prompting the installation and restart of the system. All these update operations creates logs about the operations and updated packages. In this tutorial we will look how to list, filter and search these update logs.

Windows Update Log File

First we need to locate the Windows update log file. Windows update log is by default located at systemroot . Systemroot is generally the location where the windows operating system files are installed which is C:\Windows in most cases.

Print All Update Log

We can print all the windows update log without using any filter with ¢at command. We will also use some environment variables to accurately locate SystemRoot location with $env variable.

PS> cat $env:SystemRoot\WindowsUpdate.log

As we can see from listed event logs from ¢at command output there are following information about events.

  • Date
  • Time
  • Application Exit Status
  • Subsystem
  • Explanations

Filter Logs

As we list all log files in previous step it will create a lot of output. This is not a wanted situations especially if we are looking for a specific string. We can filter log with Powershell select-string command. In this example we will list only logs those contains FATAL string. This will list all FATAL type log which is a real interrupting problem.

PS> select-string -path $env:SystemRoot\WindowsUpdate.log FATAL
Filter Logs
Filter Logs

Using Get-WindowsUpdateLog

Powershell for Windows Server 2012, Windows Server 2016, Windows 10 comes with a useful cmdlet which directly provides windows update logs without typing long and error prone commands. Get-WindowsUpdateLog powershell command can be used to list all logs like below.

PS> Get-WindowsUpdateLog

Open In Text Editor

There is more GUI and user friendly was to list windows update event logs. This will open previously stated log file in Notepad. Just put following command into windows Run

 windowsupdate.log
Open In Text Editor
Open In Text Editor

LEARN MORE  Windows Update Service Not Running Error for Windows 7, Windows 8, Windows 10, Windows Server 2008, 2012, 2016

Leave a Comment