How to Search EventLog Using PowerShell
In this post I will show you some tips on how you can search your computers EventLog using PowerShell.
This can be very powerful if you need to search for e.g. a specifik error in the EventLog.
Basic Get-EventLog command
The basic command is like shown below.
Get-EventLog -LogName System
If you want to you can filter using the parameter -EntryType to see only e.g. Errors in the eventlog:
Get-EventLog -LogName System -EntryType Error
In order to only see the newest 10 error you can enter the command below:
Get-EventLog -LogName System -EntryType Error -Newest 10
Run Get-EventLog on Remote computer
In order to check the EventLog on a remote computer you will have to use the Invoke command as shown below:
For more information about the PowerShell Get-EventLog cmd-let check out Microsoft docs
Comments
Post a Comment