SCCM 2012 – Uninstall not used application

SCCM 2012 – Uninstall not used application

Hi All,

I often get asked questions about license management. SCCM, with the help of Asset Intelligence, can generate reports of licenses for Microsoft and non-Microsoft. Microsoft license is easy, it automatically connect to Volume License website and sync the data down, it means it will download your license information and not upload it.

For non-Microsoft software, you can create a csv file and import it into the SCCM, easy isn’t it.

However, SCCM will not do anything else, it means it will not automatically deny access to an application because you don’t have enough licenses as well as it will not automatically uninstall a not-used application, you need to do this management.

Of course, the 1st is quite easy, for all paid apps (of course you’ll not do it for non-paid apps), you create a deployment that require authorisation. Once done, you can create a script do authorise only if there is enough license available, but how to check this? Well, this depends on how and where you keep this information.

The 2nd option is quite easy, uninstall a software if it is not being used for X number of days. The scenario is always the same. User X asked to have project installed but only open once to check something and never open it again

In this scenario, you can use software metering and create rules to monitor the execution of a specific .exe file (not that I don’t recommend to have many, the maximum I’ve seem was about 200 and SCCM handled it quite well. If I’m not mistaken, SCCM has a limit of 1000 rules and if you need more, I’d recommend using 3rd party vendor for it)

Anyway, once you have the rule, it is time to create a collection of the machines that have the software installed but did not run it in the last X days.

There are many options to do it, people can use file names, but I like to use add remove program information.

The query bellow will check if the software Camtasia Studio 8 is installed (not that I’m looking for both 32 and 64 bits information) and if yes, will check against the software metering database for any machine that did not run the rule RFL00013 in the last 30 days.

select distinct SMS_R_System.Name from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID = SMS_R_System.ResourceId where ((SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName = “Camtasia Studio 8”) or (SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName = “Camtasia Studio 8”))
and SMS_R_System.OperatingSystemNameAndVersion LIKE ‘%Workstation%’
and SMS_R_System.ResourceId not in (SELECT DISTINCT SMS_MonthlyUsageSummary.ResourceID FROM SMS_MonthlyUsageSummary INNER JOIN SMS_MeteredFiles ON SMS_MonthlyUsageSummary.FileID = SMS_MeteredFiles.MeteredFileID WHERE DateDiff(day, SMS_MonthlyUsageSummary.LastUsage, GetDate()) < 30 AND SMS_MeteredFiles.SecurityKey = "RFL00103") As a result, you'll have a list of all machines (note that my query only return workstation machines as I don't want to mess up with servers) Once you have the collection, you can create an uninstall deployment for that collection


Raphael is a 9 times Microsoft MVP with over 20 years of experience in IT, in which 13 years have been dedicated to System Center and Automation. His extended experience has been developed through several IT roles, from first-line support to principal consultant, towards a wide range of clients and sectors. One of the four MVPs in Enterprise Client Management in the UK, Raphael holds more than 30 Microsoft certifications and is an MCT (Microsoft Certified Trainer). Since 2008, Raphael has been providing Microsoft trainings from basic to advanced levels in several categories. Throughout his career, Raphael has joined as speaker in well-known events such as TechEd and Gartner Security Risk Management. He also organised community events and lectured around the world, sharing best practices and knowledge within the industry. Bilingual in English and Portuguese, Raphael has authored diverse articles published in Microsoft's TechEd, served as the editor-in-chief of a magazine focused on System Center in Brazil and wrote two books: "Understanding System Center 2012 SP1 Configuration Manager: The walkthrough book" and "System Center 2012 R2 Configuration Manager: Automation from Zero to Hero".

Tagged with: , , , , ,