Opps, I already posted this Count of service account used for services before… So here is another one.
SELECT Case GS.PowerSupplyState0
when 1 then ‘Other’
when 2 then ‘Unknown’
when 3 then ‘Safe’
when 4 then ‘Warning’
when 5 then ‘Critical’
when 6 then ‘Non-recoverable’
else ‘Not Defined’ end AS ‘Power Supply State’,
Count(‘Power Supply State’) AS ‘Count’
FROM v_GS_COMPUTER_SYSTEM GS
GROUP BY GS.PowerSupplyState0
Order by ‘Power Supply State’