search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
How to get System Event Logs via PowerShell
Posted in Windows Powershell | No Comment | 1,506 views | 28/05/2015 10:54

Following script will get System Logs in last hour.

1
2
3
4
5
6
7
8
9
# System Log Parameters
$SystemLogParameters = @{
LogName= "System"
EntryType= "Error","Warning"
After= (Get-Date).AddHours(-1)
}
 
# Get System Logs
Get-EventLog @SystemLogParameters

You can set scope by changing EntryType parameter.



Leave a Reply