PowerTip: Query Multiple Event Logs at Once

Doctor Scripto

Dr Scripto

Summary: Learn how to use Windows PowerShell to query multiple event logs at one time.

Hey, Scripting Guy! Question  How can I use Windows PowerShell to query events that happened and may be in multiple event logs?

Hey, Scripting Guy! Answer  Use the Get-WinEvent cmdlet, specify the LogName parameter for both logs, and specify today
           for the StartTime, for example:

Get-WinEvent @{logname='application','system';starttime=[datetime]::today }


Leave a comment