Do organization 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 spend for software licensing versus their utilization?

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

Software metering is a great feature that is not always well known by the business. Company must take the advantage of monitoring the usage and automatically uninstalling application 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 SCCM database, otherwise it won’t works.

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 loose productivity time. On the other side, being too loose, you will overpaid your licence usage. We will use a 120 days value.

Collections

Create all the devices 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 last 120 days
  3. Warning Zone : Create a warning zone to make sure the uninstaller will be executed on device that have 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 to use Asset Intelligence. Using only software metering data to target the amount of installation results to not relevant information. The Query Rule for the collection is:

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

** 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:

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

** 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 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 application on devices mostly new or devices that newly received the software or simply never use it.

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

** 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 have a minimum of warning. If your company use System Center Orchestrator, we suggest to take 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 much thing to for verification since the mechanism is based on installed software. As soon the device is completely uninstall the software do a hardware inventory scan, the devices will be excluded from Installed collection. You can also use our Inventoried Software report that monitor software 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

Founder of System Center Dudes. Nick has been awarded in 2016 as a Microsoft MVP in Enterprise Mobility category.
Working as a senior SCCM and Intune advisor as well as a specialist Microsoft Cloud solutions specialist.
Automatically Uninstall Unused Applications with SCCM
5 - 3 votes
Comments
  • ffs autoversicherungsvergleich
    Posted at 2:34 PM February 5, 2017
    ffs autoversicherungsvergleich
    Reply
    Author

    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
    Posted at 6:37 AM July 18, 2016
    Jens
    Reply
    Author

    And what does the “No Last Usage” collection contain?

    • Nicolas Pilon
      Posted at 1:32 PM July 19, 2016
      Nicolas Pilon
      Reply
      Author

      The No Last Usage is configure to include Warning Zone and exclude Last Usage over 120 Days. However, is not a mandatory collection.

  • Jens
    Posted at 6:14 AM July 18, 2016
    Jens
    Reply
    Author

    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
      Posted at 6:39 AM July 18, 2016
      Jens
      Reply
      Author

      Found the syntax errors but for others copying the code it would be nice 🙂

      • Kees
        Posted at 9:02 AM July 19, 2016
        Kees
        Reply
        Author

        Could you paste your code? Thanks!

        • Nicolas Pilon
          Posted at 1:34 PM July 19, 2016
          Nicolas Pilon
          Reply
          Author

          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
            Posted at 7:32 AM July 21, 2016
            Kees
            Author

            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
            Posted at 12:31 PM August 5, 2016
            Nicolas Pilon
            Author

            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
    Posted at 11:29 PM July 15, 2016
    Krishna
    Reply
    Author

    For instance if i have 30 licensed applications will end up in creating 30*4 collections; will that be feasible?

    • Nicolas Pilon
      Posted at 11:54 PM July 17, 2016
      Nicolas Pilon
      Reply
      Author

      Hello Krishna,

      Yes exactly. You can also configure the collection membership refresh rate, once each 7 days.

      Let us know the results.

  • tt
    Posted at 4:02 PM July 14, 2016
    tt
    Reply
    Author

    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
      Posted at 12:02 AM July 18, 2016
      Nicolas Pilon
      Reply
      Author

      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

  • Leave a Reply