I would like to write a management pack that will allow me to retrieve the ScomID of a SCOM group or server object. Therefore, script needs to execute on the SCOM Management server (rather than the client) and the object name to be passed to whatever function/script necessary to query SCOM. Where would you start with something like this?
in my self maintenance MP, there’s an agent task to get workflow ID. what you are trying to do is very similar to that task. please take a look and hopefully it will give you some ideas. you can input these script parameters as task override parameters.
The ID of the target object is available to any agent task, so write a task to simply return the ID. This task would be available for any SCOM object. To use it, locate the object in the SCOM console (via search, or a view) and run the task.
Exporting the management pack and viewing the resulting XML may give you some ideas of how to use parameters in your own task.
And lastly, don’t forget that the ID of the object is also in the Squared Up URL for an object drilldown, which is a very easy way of finding the ID.
Thank you Tao - I’ll have a look. Writing a management pack as per the demo today in terms of running a script on the client looks straight forward. The bit I need to research is how you can run a task to execute on the SCOM server but pass the parameter of the object in scope/highlighted