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...") |
(No difference)
|
Revision as of 19:05, 29 January 2021
#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