I wrote a simple Powershell script to check windows last successfully update time. And also I calculate the number of days after the last successful update. You can use it to monitor your windows servers.
This script will display if host get any update in 44 days. So also will display host last successfully update time with number of days.
#You can run script with to command I added below on batch script #powershell.exe -ExecutionPolicy RemoteSigned -Command "& {C:\Windows_Patch.ps1}" $now = Get-Date -format d $Session = New-Object -ComObject "Microsoft.Update.Session" $Searcher = $Session.CreateUpdateSearcher() $historyCount = $Searcher.GetTotalHistoryCount() $out = $Searcher.QueryHistory(0, 1) | Select-Object Date | findstr -i ':' | %{ $_.Split(" ",[StringSplitOptions]"RemoveEmptyEntries")[0] } $days = New-TimeSpan -Start $out -End $now ##Also change number of days as you wish. if (($days.Days -lt 44)) { Write-Host "Yes - $out - $days" } else { Write-Host "No - $out - $days" }