Today I want to show you guys a nice example of how we can use custom scripts to visualise data coming from SCCM in Squared Up dashboards on top of a SCOM platform. And provide a strong integration between SCCM, SCOM & Squared Up.
Squared Up is my favorite tool to create dashboards, check it out here: https://demo.squaredup.com
I’m currently in the process of setting up a brand new SCOM 1801 environment at a customer and an SCCM CB environment at the same customer with the focus on servers and server patching. The customer wanted also an easy way to check the following parameters:
- How many updates are pending on each server?
- Is there a pending reboot due to the installation of Windows Updates?
- When was the server last updated? And what Windows Updates have been applied then?
- Are there any maintenance windows applied to a server?
Lots of questions to be answered! All this information can be found somewhere hidden in the SCCM reporting or we could create some custom reports containing that info. However, due to the fact I’m not a SQL reporting guru I wanted to see if we could show all this information in an easy way using Squared Up. As all the servers also have a SCOM agent installed we could get our information directly from there. And I have to say, it was really fun and easy to do!
I’ve used some custom powershell scripts which I added as SCOM tasks, these tasks are then added to a “Windows Updates” perspective I created for each Windows Computer object and this is the result:
All the components you see in the above perspective are based on powershell scripts put in SCOM tasks.
The “Pending Updates” counter is a custom performance counter reading information from WMI, this is the script:
# Any Arguments specified will be sent to the script as a single string.
# If you need to send multiple values, delimit them with a space, semicolon or other separator and then use split.
$ScomAPI = New-Object -comObject “MOM.ScriptAPI”
# Collect your performance counter here. Note that in order to support the DW this script MUST only return a single
# object/counter and those must be static values. You can return multiple instances just fine though.
$Instances = @(“Total”)
$Metric = @(Get-WmiObject -Class CCM_SoftwareUpdate -Filter ComplianceState=0 -Namespace root\CCM\ClientSDK).Count
Foreach ($Instance in $Instances)
$PropertyBag = $ScomAPI.CreatePropertyBag()
# Send output to SCOM
On top of the perspective I’ve also added a button to install all pending updates directly from the dashboard without having to logon to the server and start the installation from Software Center. When clicking the button, Software Center kicks of the installation within minutes.
There is also an additional dashboard where they can review the servers with the most updates pending (top 20) per domain.
To finish things of I added some of the above information to the “Windows Server” perspective as well. In this way the customer can immediately see additional info (highlighted in red in the below screenshot):
- How many pending updates?
- When was the server last rebooted?
- Is there a pending reboot due to Windows Updates?
- If the server is a VM, what is the Hyper-V host the VM is running on?
Now they are using Squared Up as the go to tool for reviewing the health of the environment and for following-up on patching!
If you would like to accomplish the same or have any questions, please feel free to drop a comment below and I’ll be happy to share my scripts.
Hope this helps!