locked
run recovery task RRS feed

  • Question

  • Hi all!
    I need to run recovery task using C#. For example:
    string query = "DisplayName = 'Update Version'";
                    ManagementPackRecoveryCriteria recoveryCriteria = new ManagementPackRecoveryCriteria(query);
                    IList<ManagementPackRecovery> recoveries =  managementGroup.Monitoring.GetRecoveries(recoveryCriteria);
                    foreach (ManagementPackRecovery recovery in recoveries)
                    {//// RUN each recovery task

    }

    How can I do this?


    • Edited by compasses Friday, September 30, 2016 12:48 PM
    Friday, September 30, 2016 12:37 PM

Answers

  • Hi Sir,

    IMHO , you may try to compile it to  a .exe file to use it in recovery task .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by compasses Monday, October 3, 2016 5:43 PM
    Monday, October 3, 2016 7:27 AM
  • SCOM supports two types of recovery task : command and vbscript. for your situation, you should complie it into executable file.
    Roger
    • Marked as answer by compasses Monday, October 3, 2016 5:43 PM
    Monday, October 3, 2016 8:04 AM

All replies

  • Hi Sir,

    IMHO , you may try to compile it to  a .exe file to use it in recovery task .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by compasses Monday, October 3, 2016 5:43 PM
    Monday, October 3, 2016 7:27 AM
  • SCOM supports two types of recovery task : command and vbscript. for your situation, you should complie it into executable file.
    Roger
    • Marked as answer by compasses Monday, October 3, 2016 5:43 PM
    Monday, October 3, 2016 8:04 AM