Would you like to learn how to write an event to an event log? In this tutorial, we will show you how to create a log entry in the Event Viewer using Powershell.

• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 2022
• Windows 10
• Windows 11

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Related tutorial – PowerShell

On this page, we offer quick access to a list of tutorials related to PowerShell.

Tutorial Powershell – Writing an event to an event log

Start an elevated Powershell command line.

Windows 10 - powershell elevated

Create a custom source of events.

Copy to Clipboard

Start a Powershell command-line.

Start Powershell

Write an event on the Applications log file.

Copy to Clipboard

The event can be seen on the Windows event viewer.

POWERSHELL - CREATE EVENT LOG ENTRY

You have learned how to create an event log in Event Viewer.