Difference between revisions of "Get-Eventog"
Jump to navigation
Jump to search
(Created page with "``` #Search for All Event Log(Require Administrator previlage) Get-EventLogError -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize #Search for Windows PowerS...") |
|||
| Line 1: | Line 1: | ||
``` | ``` | ||
| + | get-eventlog -list | ||
| + | get-eventlog system -new 10 | Select-Object -Property * | ||
| + | |||
| + | |||
#Search for All Event Log(Require Administrator previlage) | #Search for All Event Log(Require Administrator previlage) | ||
Get-EventLogError -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize | Get-EventLogError -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize | ||
Latest revision as of 02:06, 3 March 2021
get-eventlog -list
get-eventlog system -new 10 | Select-Object -Property *
#Search for All Event Log(Require Administrator previlage)
Get-EventLogError -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize
#Search for Windows PowerShell Logs
Get-EventLogError -LogName "*PowerShell*" -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize
#Search for Application/System Log
Get-EventLogError -LogName @("Application","System") -FilterLevel Warning -FromLastBootupTime | Format-Table -AutoSize
#Specify Range
$from = (Get-Date).AddHours(-20)
$to = (Get-Date)
Get-EventLogError -LogName @("Application","System") -FilterLevel Warning -From $from -To $to | Format-Table -AutoSize
#Add new entry to EventLog
Write-EventLog -LogName Application -Source Application -Message "Test" -EventId 0 -EntryType information
#Get EventLog entry added after last query execution
Get-EventLogError -LogName "Application" -FilterLevel Infomational -FromLastQueryTime | Format-Table -AutoSize