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].SettingFROM [APM_ComponentTemplateSetting] AS [Setting]INNER JOIN [APM_ComponentTemplate] AS [Template]ON [Setting].ComponentTemplateID = [Template].IDINNER JOIN [APM_ExternalSetting] AS [ScriptBody]ON [Setting].Value = [ScriptBody].IDAND [Setting].ValueType = 4WHERE [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].SettingFROM [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 = 4WHERE [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.