Query to count devices in KACE Organizations
I need create a sql report to count all devices in each organization, but not in SMA Systems, in another sql tool(HeidiSQL).
We have 30 organization and this view need get the ID, Name, Description and Computer Count.
Please see what I got so far:
(select distinct count(ID) FROM ORG1.MACHINE)as 'Computer Count'
I believe it is necessary to create a loop, but I haven't got it yet.
The KUID_ORGANIZATION table appears to contain the KUID for each machine and which org it belongs to. I say appears because my SMA doesn't have orgs enabled, so I can't verify. Try this:
COUNT(KUID) as 'Computer Count'
join KBSYS.KUID_ORGANIZATION on KUID_ORGANIZATION.ID = ORGANIZATION.ID
GROUP BY ORGANIZATION.ID