https://msdn.microsoft.com/en-us/library/bb437630.aspx

Parameter

Type

Description

bstrScriptName

String

The name of the current script.

wEventID

Number

The event ID of the log entry. Any integer value from 0 to 20000.

wSeverity

Number

The severity type of the log entry. For details, see the Remarks section later 
in this topic.

bstrDescription

String

The description of the event.



You can use whatever you want.  Only caveat is you MIGHT create events that 
other MP's also use - and they MIGHT generate alerts if there are rules looking 
for those events and they were so poorly written that they only trigger off the 
Event ID.  :)

I usually just make some up wherever I feel like that day.



From: [email protected] [mailto:[email protected]] On 
Behalf Of Orlebeck, Geoffrey
Sent: Thursday, January 21, 2016 11:08 AM
To: '[email protected]' <[email protected]>
Subject: [msmom] Script Logging to Event Viewer

All:

A few months back I was on a webcast Kevin Holman did about MP authoring. One 
of many things I became aware of that day was using the 'MOM.ScriptAPI' to log 
to the Operations Manager Event Viewer log:

$api = new-object -comObject 'MOM.ScriptAPI'
$api.LogScriptEvent("<Script_Name>",<EventID>,<Level>,"<Description/Detail>")

Is there any documentation on acceptable Event IDs? Or is there a known range 
the Operations Manager log does/doesn't accept from the API? I tried a Google 
search and poking around MSDN but didn't find anything. Thanks.

-Geoff

Confidentiality Notice: This is a transmission from Community Hospital of the 
Monterey Peninsula. This message and any attached documents may be confidential 
and contain information protected by state and federal medical privacy 
statutes. They are intended only for the use of the addressee. If you are not 
the intended recipient, any disclosure, copying, or distribution of this 
information is strictly prohibited. If you received this transmission in error, 
please accept our apologies and notify the sender. Thank you.




Reply via email to