Creating an Windows Event Log Event using PowerShell (Higher than Event ID 1000)

If you want to log a test event to the Windows Event Log, you can do this many ways. But some tools only allow you to create events that are up to Event ID 1000. So if you want to create an event log entry with a number higher than that, you can use Windows PowerShell.

$evt=new-object System.Diagnostics.Eventlog(“Application”)
$evt.Source=”Culham.net”
$evtNumber=7500
$evtDescription=”This is a Test Event”
$infoevent=[System.Diagnostics.EventLogEntryType]::Warning
$evt.WriteEntry($evtDescription,$infoevent,$evtNumber)

 
Comments

No comments yet.

Leave a Reply