Skip to main content

Event Viewer: how to send notification E-Mail messages with Powershell

Since its introduction in the first Windows NT Server, the Event Viewer has always been an essential tool for any System Administrator as the primary source to detect, locate and review a vast majority of issues related to Windows programs, services, frameworks, and even third-party installed software in order to improve the performances and the overall stability of any virtual or physical machine.

It’s almost sad that, despite all these years, this tool is still affected – at least in my humble opinion – by at least two major issues:

  • the constant slowness, due to the fact that all logs are basically stored in log files which are then parsed in real-time by the application itself resulting in a severe performance impact.
  • the unconfortable location, nested inside the Control Panel > Administrative Tools since it’s meant to be used by admins only.

These two issues are often the reason why the Event Viewer is still not always used by many users & admins who tend to forget about its existence, leaving errors and warnings that could easily be solved as they pile up.

This post shows a way to avoid this undesirable behavior by setting up a simple e-mail notification system of all the system event as soon as they’re made available to the Event Viewer. The system will also allow the user to choose the event log file (Application, Security, Setup & more) and/or the event type (Information, Error & more) and/or the event ID: let’s see how to achieve such result.

Read More

Start, Stop and Restart IIS from a Remote PC


One of the most common SysAdmin requirements when operating on a Server Farm is being able to remotely start, stop and restart an instance of IIS from a different node on the same network, maybe before issuing a backup task or a similar cron job.

The best way to achieve such result is using PowerShell commands: before you can do that, you need to set either the node you’ll use to issue the command – we’ll call it the Source PC – and the node hosting the IIS instance you want to manage – we’ll call it the Target PC – as Trusted Hosts between each other: let’s see how to do that. Read More