Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmhuglen/0f65e6a1e73e811b7de2d5eea30b1494 to your computer and use it in GitHub Desktop.
Save kmhuglen/0f65e6a1e73e811b7de2d5eea30b1494 to your computer and use it in GitHub Desktop.
$EntryType = "{Output - 1 - Value from "monitor Orchestrator SNMP Traps"}"
$Message = "{Output - 2 - Value from "monitor Orchestrator SNMP Traps"} - {Output - 3 - Value from "monitor Orchestrator SNMP Traps"}"
$EventID = "1000"
$LogName = "SNMPTrapMonitor"
$SourceName = "SNMPTrapMonitor"
$NewEventLog = Get-EventLog -list | Where-Object {$_.logdisplayname -eq $LogName}
IF (!$NewEventLog.Log -eq $LogName) {New-EventLog -LogName $LogName -Source $SourceName}
Write-EventLog -logname $LogName -source $SourceName -eventID $EventID -message $Message -EntryType $EntryType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment