Create an Event ID higher than 1000 using powershell

You may have created a monitor in SCOM that looks to trigger an alert upon the discovery of  a particular Event in the Event Log and you want to test this by simulating the Event. There are tools out there that can do this but I haven’t found one that can generate an event greater than Event i.d. 1000. Luckily Powershell can do this…….just change the parameters in the script below to suit your needs.

$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)

Advertisements
This entry was posted in Powershell for SCOM and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s