Query KACE for users who have more than 1 laptop?
Looking for help on designing a query for KACE, to help us find out what users have more than one laptop in their possession.
1) KACE counts number of devices assigned to each user
2) KACE reports back any user with a device count greater than 1
Has anyone done this?
it really depends what you _REALLY_ need.
You can create a report using the wizard which you can improve with a count()-statement to count all nessesary numbers.
Try this report, it simply uses the ASSET table to link to USER, so you can see the name and MACHINE to show the chassis type, it will only work if your Device Names are the same as their associated asset names.
SELECT USER.FULL_NAME, ASSET.NAME, MACHINE.CHASSIS_TYPE
FROM (ASSET ASSET
INNER JOIN MACHINE MACHINE ON (ASSET.NAME = MACHINE.NAME))
INNER JOIN USER USER ON (ASSET.OWNER_ID = USER.ID)
If you put this into your SMA as an SQL report and choose to Break Columns on FULL_NAME it will be obvious which users have multiple devices assigned to them
Personally I prefer to use just the Machine table because I get to see people are using multiple machines that might not have been intended for them when I assigned them as assets. I exclude the Administrator account and anything when the last user has not been registered:
Count(MACHINE.NAME) As Count_NAME,
MACHINE Left Join
MACHINE) Machines On Machines.USER_FULLNAME = MACHINE.USER_FULLNAME
MACHINE.USER_FULLNAME <> "" And
MACHINE.USER_FULLNAME <> "Administrator"
Count(MACHINE.NAME) > 1