Creating SCOM Alert Count Dashboard using the PowerShell Grid Widget

Creating dashboard using the PowerShell Grid widget can offer a lot of flexibility in the way you want to consume the data out of Operations Manager. In my experience, however, it can be much more difficult to configure than the other widgets.
This post will detail the steps for configuring the dashboard to suit your environment. I will also explain each section of the script, and what it is used for.
The first step is to initialize a table variable in the following manner. The table name does not matter and is not used. The object type has to be the one listed. This table will be where we will add any Alerts we wish to display in the dashboard.

Once the table variable is created, any script can be utilized to insert data into it. For example, in the script below we are creating an Alert Count for three specific monitors, targeted at a specific group. The group we use for this example is called “Dashboard Target Group”.

Once the script is working as desired we can begin formatting the output table using the Alert variables (In the example using $DiskAlerts, $MemoryAlerts, and $CPUAlerts). In our example, we will be adding the name of the Alert and the Alert Count into the Output Table.

Now that the $OutputTable variable contains all data that we want on the dashboard, the next step is to format the data into a form that the SCOM console will accept, which the following portion of the script will perform.
Some notes on this portion of the script. The $ScriptContext variable is a global variable using in SCOM, which will prevent the script from running successfully outside of a PowerShell Grid Widget. The xsd://foo!bar/baz definition does not matter and can be named anything after the XSD:// declaration.

The full script is listed below:

By |2019-01-25T08:33:32+00:00October 2nd, 2015|Uncategorized|0 Comments

About the Author:

steve bowman

Model Technology

Let us help you get your end point and data center strategy on cruise control!  Ask about our Calibration Assessment.


  • 12125 Woodcrest Executive Drive, Ste. 204 Creve Coeur, MO 63141
  • (314) 254-4138