Posted in
Windows Powershell |
No Comment | 1,584 views | 28/05/2015 10:51
Following script will get Application Logs in last hour with “vmic*” source logs.
1
2
3
4
5
6
7
8
9
| # Application Log Parameters
$ApplicationLogParameters = @{
LogName= "Application"
EntryType= "Error","Warning"
After= (Get-Date).AddHours(-1)
}
# Get Application Logs
Get-EventLog @ApplicationLogParameters -Source vmic* |
# Application Log Parameters
$ApplicationLogParameters = @{
LogName= "Application"
EntryType= "Error","Warning"
After= (Get-Date).AddHours(-1)
}
# Get Application Logs
Get-EventLog @ApplicationLogParameters -Source vmic*
You can set scope by changing EntryType parameter.