How To Write to SCOM Operations Manager Event Log Using PowerShell and MOM.ScriptAPI
The following commands can be executed using the normal PowerShell console. SCOM PowerShell snapin is not required.
$momapi = New-Object -comObject "MOM.ScriptAPI"
$momapi.LogScriptEvent("test",9999,2,"this is a test")
This is the log:
Detailed documentation of MOM.ScriptAPI can be found on MSDN
Leave a comment