cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 9

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

 

0 Kudos
3 Replies
Community Manager
Community Manager

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

"Shoot for the stars to reach the moon"

Hi,

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

Thanks

 

0 Kudos
Community Manager
Community Manager

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.

"Shoot for the stars to reach the moon"
0 Kudos