Write-EventLog

You can create dummy sources in the application log if you want to test alerts. In this example I needed to test an event logged on an Azure AD Connect server so needed the Directory Synchronization source.

Create the source:

New-EventLog -LogName Application -Source "Directory Synchronization"

Now you can create events:

Write-EventLog -LogName Application -Source "Directory Synchronization" -EventId 106 -EntryType Error -Message "test" -Category 0

Comments