locked
Create SCOM Alert using powershell RRS feed

  • Question

  • Hey Guys,

    Is there any way to create a SCOM alert using powershell or some command line tool. I used to do it with Orchestrator using Create Alert activity from SCOM IP. Now i'm only using powershell. I do believe there must be a way to create alert in SCOM from powershell script. Let me know if you can help with that.


    • Edited by smartstyle Wednesday, September 19, 2018 9:14 PM
    Wednesday, September 19, 2018 5:34 PM

Answers

  • Hi,

    In short, no. We cannot generate an alert using PowerShell directly. However, in test environment, we can create a rule based on a specific Event ID to trigger the alert. And, for Event ID, we can use command to create one.

    Command example to create event

    eventcreate /L Application /T information /ID 999 /D "This is a test event" /SO TestEvent


    To create a rule based on Event ID:




    Hope the above information helps.

    Regards,

    Alex Zhu
    -----------------------------------------------
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Thursday, September 20, 2018 1:45 AM

All replies

  • Hi,

    In short, no. We cannot generate an alert using PowerShell directly. However, in test environment, we can create a rule based on a specific Event ID to trigger the alert. And, for Event ID, we can use command to create one.

    Command example to create event

    eventcreate /L Application /T information /ID 999 /D "This is a test event" /SO TestEvent


    To create a rule based on Event ID:




    Hope the above information helps.

    Regards,

    Alex Zhu
    -----------------------------------------------
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.
    Thursday, September 20, 2018 1:45 AM
  • All SCOM alerts are raised by monitor or rule. It is not feasible to create alert by using powershell. As per Alex Zhu said, you can create a rule based on a specific Event ID to trigger the alert. And, for Event ID, we can use command to create one.
    For refering to MS document "How to test email notification settings in Operations Manager", it provides guide you how to create a event rule and create related event.
    https://support.microsoft.com/en-hk/help/934756/how-to-test-email-notification-settings-in-operations-manager

    Roger

    Thursday, September 20, 2018 2:09 AM