Warning: Declaration of WPSDAdminConfigAction::render() should be compatible with WPSDWPPlugin::render($ug_name, $ug_vars = Array, $action = NULL) in /customers/5/3/0/biks.net/httpd.www/wp-content/plugins/wp-stats-dashboard/classes/action/WPSDAdminConfigAction.php on line 42 Get Runbook GUID or Parameter | My Cloud - Christian 'Biks'

Get Runbook GUID or Parameter

I sometimes find it redundant looking up the runbook and parameter guids when creating a new powershell script to invoke a runbook from the web service.  Here is a SQL query to look up the runbook by name and every parameter that you would need to use the web service to start the runbook.

Select lower(POLICIES.UniqueID) as RunbookID, lower(CUSTOM_START_PARAMETERS.UniqueID) as ParameterID, CUSTOM_START_PARAMETERS.value
From POLICIES
INNER JOIN OBJECTS  on POLICIES.UniqueID = OBJECTS.ParentID
LEFT OUTER JOIN CUSTOM_START_PARAMETERS on OBJECTS.UniqueID = CUSTOM_START_PARAMETERS.ParentID
Where POLICIES.Name = ‘My Runbook Name’ and policies.deleted = 0

Note that the query uses the lower() function to force the guids to lowercase.  This is required for the parameters when invoking a runbook or you will receive a 500 Internal Server Error.  The runbook guid doesn’t seem to matter if it’s upper or lower case, but the parameters NEED to be in lowercase (bug??/feature??).

This will return the PolicyID (RunbookID), Parameter guid, and the name required to start the runbook from the web service.

Comments are closed.