Run a query about licensed component monitors in SAM

The query is from the below site but re-written to work in SWQL Studio or a custom query

Run a report about licensed component monitors in SAM (solarwinds.com)

Hope its useful, I also adjust the case part and just show the column data as I want to found out the actual total not that its 50 for AppInsight, etc.

replace -

CASE WHEN r.Template = 'Windows Scheduled Tasks' THEN 5 WHEN r.Template LIKE 'AppInsight for IIS' THEN 30 WHEN r.Template LIKE 'AppInsight for%' THEN 50 ELSE COUNT(r.[ComponentID])
with this -
COUNT(r.[ComponentID]) AS [Licenses Used]
Anonymous