Get Eventlog error messages remotely, output to html file (Powershell)

** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK **

I use this script on all my servers to collect system and application event log errors on a recurring basis. The version I use puts all the html files on a share drive so I can get all the logs from one location.

To create a scheduled task on your server to run the script automatically you would have to create a bat file and call the powershell script. Something similar to this:

 

You can use this same script to get both system and application logs, just change the $log variable to whichever you wish and run it.

Tested with Windows 7, Windows Vista, Windows Server 2003, Windows Server 2K8 and 2K8 R2.

 

Leave a Reply