Problem:
- You are metering software already (for this example, I'm using Evernote)
- You want to remove software that has not been launched/used in X amount of days/hours/minutes
- You are on version 6.3.x and newer
- In Smart Labels for Devices, there is not drop down for Metering Usage
Solution:
WORKAROUND
Create a Smart Label by modifying the MySQL query
Instructions:
- Click Inventory > Devices
- Click Smart Label
- Create a dummy smart label
- Just use whatever the default criteria is
- Name your label something along the lines of "Machines not using Evernote 6.x"
- Click Create to create the label
- In the drop-down green bar, click the [Smart Label List] link which takes you to the Smart Label list
- NOTE: You can also go to Home > Labels > Smart Labels
- Click the name of your smart label
- Click the Edit SQL button
- Paste in the query below:
/* SAMPLE SMART LABEL FOR METERED MACHINES WITH EVERNOTE THAT HAVE NOT BEEN USED IN 90 DAYS */
select MACHINE.NAME, USER, OS_NAME, SAM_CATALOG.NAME, SAM_METER_DATA.END
from MACHINE
LEFT JOIN SAM_METER_DATA ON
MACHINE.ID = SAM_METER_DATA.MACHINE_ID AND
LATEST_ENTRY = 1
LEFT JOINCATALOG.SAM_CATALOG ON
SAM_CATALOG.ID = TITLED_APPLICATION_ID
-- WE CHECK SAM_MACHINE_JT AS WELL TO MAKE SURE IT IS INSTALLED
INNER JOIN SAM_MACHINE_JT ON
SAM_MACHINE_JT.MACHINE_ID = MACHINE.ID AND
SAM_MACHINE_JT.SAM_CATALOG_ID = SAM_METER_DATA.TITLED_APPLICATION_ID
WHERE SAM_CATALOG.NAME LIKE 'EVERNOTE 6.x%' AND
END < (NOW() - INTERVAL 90 DAY)
10. Click Save
11. Force an inventory on a machine that you know has the device
Now you can apply that label either to a script or a Managed Install to remove software from those targeted computers.
Appendix
Explaining the SQL
To edit the parameters to get what YOU want:
Where is says:
Like 'Evernote 6.x%'
Is basically saying:
Where the software catalog name begins with 'Evernote 6.x'
To edit the date range:
Where it says:
END < (NOW() -
INTERVAL 90 DAY)
It's basically saying the software hasn't been launched in the last 90 days.
If say i wanted to do 30 days, you can just switch 90 to 30.
Shout out to Craig T. for writing the SQL query
Comments