Posted in
Windows Powershell |
No Comment | 1,507 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 |
# 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.