Powershell Windows Eventlog script

This week i found the report-events Powershell script (see figure 1). The script is made by Jeffrey Hicks. It generates a nice HTML file with errors and warnings from the Windows eventlog.


figure 1. Output reports-event script

You can specify multiple servers in a text file, select how many hours from the current time to look in the eventlog and e-mail the HTML file after generation. 

The following syntax can be used:

get-content c:\script\servers.txt | c:\scripts\report-event.ps1 – report c:\script\eventlog.html –hours 48 –smtp mail.beerenss.nl –sendto eventlogs@beerens.nl –from eventlog@beerens.nl


get-content c:\script\servers.txt, text file containing the server names

– report c:\script\eventlog.html, name of the HTML file

| c:\scripts\report-event.ps1, call the actually script

–hours 48, hours to report from the curren time

–smtp mail.beerens.nl. SMTP server to sent the HTML rapport 

–sendto ivo@beerens.nl, To address

–from eventlog@beerens.nl . from address


Schedule this script to run frequently to watch your eventlogs!


Download the script here.


2 thoughts on “Powershell Windows Eventlog script”

Leave a Comment