0

How To Write to SCOM Operations Manager Event Log Using PowerShell and MOM.ScriptAPI

Posted by Tao Yang on 07/07/2010 in PowerShell, SCOM |

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:

image

 

Detailed documentation of MOM.ScriptAPI can be found on MSDN.

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2010-2012 Tao Yang's System Management Blog All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.0, from BuyNowShop.com.