Do organizations pay too much for your software licensing? Paying more licences than you use doesn’t make your company really effective, especially when we talk about IT Cost Transparency. Do you know how much money your company spends on software licensing versus their utilization?

Using inventory, SCCM detects if an application is installed, it also monitors usage using Software Metering and uninstalls the application using deployment mechanisms. Combining all, you can deliver a great solution to minimize licences cost to your organization.

Software metering is a great feature that is not always well known by the business. The company must take the advantage of monitoring the usage and automatically uninstalling applications that are unused. For more details about Software Metering, read this TechNet post.

This post shows how to automatically uninstall unused applications with SCCM witch is also part 5 of the Asset Intelligence Blog Series.

Pre-Requisites

The first thing you must do is enable and configure the software metering based on Asset IntelligenceSoftware metering is a feature used in SCCM to monitor and collect software usage data. The data collected from all the devices must be present in the SCCM database, otherwise, it won’t work.

You also need to decide what will be the grace period in days, before you consider an unused application. If you’re too aggressive, users will need to reinstall the applications more frequently and lose productivity time. On the other side, being too loose, you will overpay your licence usage. We will use a 120 days value.

Collections

Create all the device collections assigned to an application. You create collections that will :

  1. Installed: Target devices where the application is installed
  2. Last Usage in last 120 Days: Target devices that use the application in the last 120 days
  3. Warning Zone: Create a warning zone to make sure the uninstaller will be executed on a device that has at least run the application one time
  4. Last Usage over 120 Days: Target devices that use the application over 120 days

SCCM Automatically uninstall application

Installed

This collection lists all devices that have the application installed. You have the possibility to use data from Add Remove Programs or Asset Intelligence, we suggest using Asset Intelligence. Using only software metering data to target the number of installation results to not relevant information. The Query Rule for the collection is:

[su_note note_color=”#d2d2d2″ radius=”8″]SELECT SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceId = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName = “Application Name“[/su_note]

** Change the application name in the query with your selected application.

Last Usage in last 120 days

This collection lists all devices that use the application properly in the last 120 days and will not be uninstalled. The Query Rule for the collection is:

[su_note note_color=”#d2d2d2″ radius=”8″]select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup,  SMS_R_SYSTEM.Client from SMS_R_SYSTEM  inner join SMS_MonthlyUsageSummary on SMS_R_SYSTEM.ResourceID = SMS_MonthlyUsageSummary.ResourceID    INNER JOIN SMS_MeteredFiles ON SMS_MonthlyUsageSummary.FileID = SMS_MeteredFile.MeteredFileID WHERE SMS_MeteredFiles.ProductName = ‘Application Name‘  AND DateDiff(day, SMS_MonthlyUsageSummary.LastUsage, GetDate()) < 120[/su_note]

** Change the application name in the query with your selected application and the number 120 days  with your grace period time.

Warning Zone

Warning Zone shows devices that have the software installed without being used for 120 days. The Membership Rules are :

SCCM Automatically uninstall application

  • Include the Installed collection
  • Exclude devices from the Last Usage in the last 120 days collection

Last Usage over 120 days

The collection Last Usage over 120 days contains devices that used at least one time the software over 90 days.

By limiting the collection membership to the Warning Zone, it targets devices that have at least run the software. You make sure to not uninstall the application on devices mostly new or devices that newly received the software or simply never use it.

[su_note note_color=”#d2d2d2″ radius=”8″]select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_SYSTEM  inner join SMS_MonthlyUsageSummary on SMS_R_SYSTEM.ResourceID = SMS_MonthlyUsageSummary.ResourceID    INNER JOIN SMS_MeteredFiles ON SMS_MonthlyUsageSummary.FileID = SMS_MeteredFile.MeteredFileID WHERE SMS_MeteredFiles.ProductName = ‘Application Name‘  AND SMS_MonthlyUsageSummary.LastUsage IS NOT NULL[/su_note]

** Change the application name in the query with your selected application

Uninstall Deployment

Prepare your uninstaller command and once approved, deploy to the Last Usage over 90 days collection. Make sure the deployment is quiet or has a minimum of warning. If your company uses System Center Orchestrator, we suggest taking a look at this blog series by Neil Peterson. He wrote a couple of posts on Software Metering Deep Dive and Automation, The Basics, The Collections and Orchestrator Integration. The integration with Orchestrator ensures that users are warned before getting their application uninstalled. 

Verification

There’s not many things for verification since the mechanism is based on installed software. As soon the device is completely uninstalled the software does a hardware inventory scan, the devices will be excluded from the Installed collection. You can also use our inventory software report that monitors software’s last usage based on installation.

sccm 2012 software metering custom reports

If you are interested to configure software metrics and monitor usage with SCCM, take time to read our Asset Intelligence Blog Series:

SCCM Automatically uninstall application

Comments (27)

George Mihailovski

09.08.2021 AT 09:20 PM
Actually looks like the article is riddled with quite a few problems. There is confusion over collection names and meanings for example towards the end its talking about 90 day collection over 120 days mentioned in the article. But then the next question of course is why is this collection being targeted and not the warning zone collection? Then there is this statement: Warning Zone: Create a warning zone to make sure the uninstaller will be executed on a device that has at least run the application one time If the author had some time to update the article it could be extremely useful. And thanks of course for taking the time to create it 🙂

George Mihailovski

09.08.2021 AT 07:54 PM
The article may be out of date unfortunately. Last usage in 120 days query as an example does not work due to a syntax error.

assetsandcontracts

08.04.2020 AT 10:55 PM
Is there a way to bring back for a user on a machine just the software we have tagged that we are interested in We are using the v_R_User joined to v_R_System joined to v_GS_INSTALLEDSOFTWARE_CATEGORISED and are trying to JOIN TO v_LU_SOFTWARELIST to filted by Tag1ID. The query below brings back a lot of duplication SELECT dbo.v_R_User.Full_User_Name0, dbo.v_R_User.title0, dbo.v_R_User.department0, dbo.v_R_System.Name0, dbo.v_GS_INSTALLED_SOFTWARE_CATEGORIZED.Publisher0, dbo.v_GS_INSTALLED_SOFTWARE_CATEGORIZED.ProductName0 FROM dbo.v_LU_SoftwareList INNER JOIN dbo.v_GS_INSTALLED_SOFTWARE_CATEGORIZED ON dbo.v_LU_SoftwareList.Tag1ID = dbo.v_GS_INSTALLED_SOFTWARE_CATEGORIZED.Tag1ID INNER JOIN dbo.v_R_User INNER JOIN dbo.v_R_System ON dbo.v_R_User.User_Name0 = dbo.v_R_System.User_Name0 ON dbo.v_GS_INSTALLED_SOFTWARE_CATEGORIZED.ResourceID = dbo.v_R_System.ResourceID WHERE Tag1Name = 'CCC Allow' AND department0 LIKE 'CSTS A%' ORDER BY department0, Full_User_Name0, Publisher0, ProductName0

Francis

02.14.2020 AT 01:33 PM
It's a old post but I have error of syntax WQL with this portion of SQL select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_SYSTEM inner join SMS_MonthlyUsageSummary on SMS_R_SYSTEM.ResourceID = SMS_MonthlyUsageSummary.ResourceID

EmilSkibsted

08.17.2020 AT 07:42 AM
Yea we are having same issue here. WQL Syntax error. I can fine use SQL queries to find the data though. Any ideas?

Morten

11.27.2018 AT 04:58 PM
Hi Nicolas I took the time to make a script which will automatically create your solution. Thought i would share it here for others to use: https://www.mroenborg.com/automatically-create-device-collections-based-on-software-meetering-rules/

SCCM_Buff

03.26.2018 AT 03:15 PM
HI, We are dealing with 180 days , but there also its been mention "deploy to the Last Usage over 90 days collection", do we need to create a different collection ?

Ron

07.11.2017 AT 09:38 AM
i tried to create collection for 120 days but I can't find SMS_MonthlyUsageSummary on attribute class when i'm building the query because I did copy-paste it gave me error. Can anyone guide me on this? Thanks.

TR

07.11.2019 AT 03:55 PM
Same here. Is there an answer to this?

FR

02.21.2020 AT 08:41 AM
Same here, anyone fond a solution

Gregory B

06.28.2017 AT 09:40 PM
Hi Nicolas, Excellent reading. As I have seen a lot of people having difficulties to implement it and as I had a loft of rules, I have made it easy with a PowerShell script: https://gallery.technet.microsoft.com/SCCM-Collection-for-7a3e798b I have added the possibility to set a custom schedule for the collections, a custom amount of days for the usage and the possibility to add a prefix to the name of the collections. Cheers

IT Dept

06.13.2017 AT 09:59 AM
SHould I set the deployment to always rerun or run once. Im finding that it is uninstalling the software, the user calls to get it put back on, & it uninstalls again. Do I set it to never rerun? If so if it falls in the collection in the next 90 days it will not be removed. - Thanks

ffs autoversicherungsvergleich

02.05.2017 AT 02:34 PM
KHK har imponerat i de meningslösa matcherna. Sen är det givetvis ingen nackdel att vinna matcher på försäsongen. Tror nog KHK kan undvika negativt kval...

Jens

07.18.2016 AT 06:37 AM
And what does the "No Last Usage" collection contain?

Nicolas Pilon

07.19.2016 AT 01:32 PM
The No Last Usage is configure to include Warning Zone and exclude Last Usage over 120 Days. However, is not a mandatory collection.

Jens

07.18.2016 AT 06:14 AM
When I copy/paste the code to my collection and wnat to save it errors out with syntax error. Is it possible to for you to review the code so it's ready for copy/paste?

Jens

07.18.2016 AT 06:39 AM
Found the syntax errors but for others copying the code it would be nice 🙂

Kees

07.19.2016 AT 09:02 AM
Could you paste your code? Thanks!

Nicolas Pilon

07.19.2016 AT 01:34 PM
Hello Jens, I would like to know what was the syntax error and what you changed to resolve it. Sometimes, copy paste from web is not copying perfectly. Thanks for your time

Kees

07.21.2016 AT 07:32 AM
I'm using this one for the "Installed Application", which works: select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_INSTALLED_SOFTWARE on SMS_G_System_INSTALLED_SOFTWARE.ResourceID = SMS_R_System.ResourceId where SMS_G_System_INSTALLED_SOFTWARE.ProductName like "Adobe Reader%"

Nicolas Pilon

08.05.2016 AT 12:31 PM
Hello Kees, Thanks for you query. I compared both and the difference is how want to target your application. In your case, it's Like with '%%'. I our case, it's = with 'Application Name' If you are targeting all version, you're ok. If you want a specific software and version, you can choose the equal. Finally, it depends the situation! Thanks

Krishna

07.15.2016 AT 11:29 PM
For instance if i have 30 licensed applications will end up in creating 30*4 collections; will that be feasible?

Nicolas Pilon

07.17.2016 AT 11:54 PM
Hello Krishna, Yes exactly. You can also configure the collection membership refresh rate, once each 7 days. Let us know the results.

tt

07.14.2016 AT 04:02 PM
Where is the No Last Usage Collection used, I see it is limited to Warning Zone, But I am not sure on the query to use for it and how it applies to Over 120 Days. Thanks

Nicolas Pilon

07.18.2016 AT 12:02 AM
Hello TT, The No Last Usage collection is not mandatory. However, the collection membership is configure to include Warning Zone and exclude Last Usage over 120 Days. The Warning Zone is the devices that have the application installed and exclude devices that used the application. Thanks