This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SAM Template Windows Script Monitor

Hi ,

We have a few SAM templates defined where we are running Windows Script Monitor. Can someone guide me to the DB table which I can query and find out the exact contents of the Windows Script Monitor?

Thanks,

Arnab

  • Are you looking for the results or the definition of the Script Monitor?  Because they are in two different places.

  • Hi,

    I am looking for the actual script which we are running. Not the results.

    Thanks

  • You can run this to get the scripts:

    SELECT [Template].Name AS [Script Type]
    ,[Setting].[ComponentTemplateID]
    ,[Setting].[Key]
    ,[Setting].[Value]
    ,[Setting].[ValueType]
    ,[ScriptBody].Setting
    FROM [APM_ComponentTemplateSetting] AS [Setting]
    INNER JOIN [APM_ComponentTemplate] AS [Template]
    ON [Setting].ComponentTemplateID = [Template].ID
    INNER JOIN [APM_ExternalSetting] AS [ScriptBody]
    ON [Setting].Value = [ScriptBody].ID
    AND [Setting].ValueType = 4
    WHERE [Setting].[Key] in ( 'ScriptArguments', 'ScriptBody', 'CommandLineToPass' )

    And this to get the other values (parameters and such)

    SELECT [Template].Name AS [Script Type]
    ,[Setting].[ComponentTemplateID]
    ,[Setting].[Key]
    ,[Setting].[Value]
    ,[Setting].[ValueType]
    -- ,[ScriptBody].Setting
    FROM [APM_ComponentTemplateSetting] AS [Setting]
    INNER JOIN [APM_ComponentTemplate] AS [Template]
    ON [Setting].ComponentTemplateID = [Template].ID
    --INNER JOIN [APM_ExternalSetting] AS [ScriptBody]
    -- ON [Setting].Value = [ScriptBody].ID
    -- AND [Setting].ValueType = 4
    WHERE [Setting].[Key] in ( 'ScriptArguments', 'ScriptBody', 'CommandLineToPass' )

     There's probably a more elegant way to get this, but this is rough and tumble and should provide most of what you need.

  • I think this answers what you need.

    However, if you can find more from a different angle if you look at an additional audit table I made - to log script changes for security purposes.   Trigger based.

    If you need it but can't find it, just drop me a line.