October 21st, 2015

PowerTip: Query Multiple Event Logs at Once

Doctor Scripto
Scripter

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 }

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

0 comments

Discussion are closed.