locked
How do I troubleshoot issues with SCOM's execution of VBS code? RRS feed

  • Question

  • I have a monitor that runs vbs code, It's either not running, or the code is failing.
    The code works when I copy paste it to a file and run it with cscript.exe

    How can I troubleshoot the process from within SCOM?

    I need to know if the code is being run,
    I'd like to know if I can force the vbs code to run from scom for troubleshooting purposes.
    I'd like to know how to edit the vbs code that SCOM is going to run - so I can enable some logging features in the code.
    It'd be great to know what user ID the code is running under.

    Thanks,

    - Jack

    Thursday, February 3, 2011 2:21 PM

Answers

  • what kind of workflow is it?  Is it a discovery?

    If it is a failed workflow, it will be unscheduled - check the failed workflow report under agent health.

    If it is not in the failed list, make sure it is in the running workflow list - via the running workflow report

    If it is not running and not failed, then see if it is disabled.

    The script will be run in the account used by the run-as-profile associated with the workflow.  If you don't have a run-as profile mapped, then it will run as the default action account.

    If it runs for you when you are logged in interactively, look at the operations manager log - are there errors?


    Microsoft Corporation
    • Marked as answer by Nicholas Li Monday, February 7, 2011 4:54 AM
    Thursday, February 3, 2011 4:29 PM
  • Hi

    Kevin Holman has given a detailed explanation of how to troubleshoot discovery scripts here:

    http://blogs.technet.com/b/kevinholman/archive/2010/03/09/basic-troubleshooting-of-discovery-scripts.aspx

    It is exactly the same process to troubleshoot other scripts - the only really difference will be that you'll need to open the script to find out what the parameters are that are being fed into the script.

    As Dan says regarding the account used to execute the script - it depends.

    1) In general, the script will executed using the agents default action account - usually local system. You can see the account being used under Administration, Agent Management, Agent Managed

    2) You can use Run As Accounts and Run As Profiles to have specific scripts \ monitoring take place using alternate credentials to the default action account.

    http://technet.microsoft.com/en-us/library/bb735423.aspx

    Cheers

    Graham


    View OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
    • Marked as answer by Nicholas Li Monday, February 7, 2011 4:54 AM
    Friday, February 4, 2011 10:49 AM

All replies

  • what kind of workflow is it?  Is it a discovery?

    If it is a failed workflow, it will be unscheduled - check the failed workflow report under agent health.

    If it is not in the failed list, make sure it is in the running workflow list - via the running workflow report

    If it is not running and not failed, then see if it is disabled.

    The script will be run in the account used by the run-as-profile associated with the workflow.  If you don't have a run-as profile mapped, then it will run as the default action account.

    If it runs for you when you are logged in interactively, look at the operations manager log - are there errors?


    Microsoft Corporation
    • Marked as answer by Nicholas Li Monday, February 7, 2011 4:54 AM
    Thursday, February 3, 2011 4:29 PM
  • Hi

    Kevin Holman has given a detailed explanation of how to troubleshoot discovery scripts here:

    http://blogs.technet.com/b/kevinholman/archive/2010/03/09/basic-troubleshooting-of-discovery-scripts.aspx

    It is exactly the same process to troubleshoot other scripts - the only really difference will be that you'll need to open the script to find out what the parameters are that are being fed into the script.

    As Dan says regarding the account used to execute the script - it depends.

    1) In general, the script will executed using the agents default action account - usually local system. You can see the account being used under Administration, Agent Management, Agent Managed

    2) You can use Run As Accounts and Run As Profiles to have specific scripts \ monitoring take place using alternate credentials to the default action account.

    http://technet.microsoft.com/en-us/library/bb735423.aspx

    Cheers

    Graham


    View OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/
    • Marked as answer by Nicholas Li Monday, February 7, 2011 4:54 AM
    Friday, February 4, 2011 10:49 AM