$ComputerName = "SOMESERVER"
[String[]]$EventLogNames=@("Application","System")#Main eventlogs $EventStartDate = get-date -date "18/12/2013 7:00pm" #(Get-Date).addhours(-1) $EventEndTime = get-date -date "18/12/2013 9:00pm" #(Get-Date).addhours(-0) $EventCritea = @{logname = $EventLogNames; StartTime=$EventStartDate; EndTime=$EventEndTime} Get-WinEvent -ComputerName $ComputerName -FilterHashTable $EventCritea -ErrorAction SilentlyContinue | fl |
Pretty simple really.
No comments:
Post a Comment