PowerTip: Find the Number of Entries in Event Logs

Summary:  Use Windows PowerShell to find the number of entries in all event logs and ETL logs?

 Hey, Scripting Guy! Question How can you use Windows PowerShell to show how many entries exist in all traditional event logs as well as ETL logs?

Hey, Scripting Guy! Answer Use the Get-WinEvent cmdlet and pass a wild card to the –ListLog parameter. Sort the recordcount in a descending manner, and select both the recordcount and logname. To tighten up the output, pipe the results to the Format-Table cmdlet and use –autosize.

Get-WinEvent -ListLog * -ea 0 | sort recordcount -Descending |

select recordcount, logname | Format-Table -auto