Powershell Tip : Show last events logs to HTML


In this post I'll show you a easy way to export and list  event logs to HTLM.




Which events to export ?

In my case I choose to list the last 5 system and application errors :

  • $All_System_Error = get-eventlog System | where {$_.EntryType -eq "Error"} | select timegenerated, source, eventid, message
  • $All_Apps_Error = get-eventlog Application | where {$_.EntryType -eq "Error"} | select timegenerated, source, eventid, message



How it looks ?

List of last 5 system and application errors




How to use it ?

1 ) Copy the "systanddeploy.css" file in %temp%

2 ) Choose what you want to list as below :
Example to list last 5 system erros







  • All_System_Error  : To list System error
  • All_Apps_Error : To list Applications error


How to get the script ?

Share this

Related Posts

Previous
Next Post »