none
Installed Applications vs Installed Software - After successfully removing an installed program via WMIC script (package) RRS feed

  • Question

  • Hi Guys

    I'm looking to remove a particular application from around 150 machines.  The advice online for this particular app is to use a WMI command and then deploy it as a package.

    In testing this has gone well and successfully removed the application.

    My problem is that some of those machines that have successfully run the command and removed the application are still showing in my collection to find "machines with application x installed" (see collection below)

    If I run resource explorer on the machine that ran the script successfully, the application still shows under Installed Applications and Installed Software.  I assume this is the reason the machine is still in the collection.

    Questions:

    What is the difference between Installed Applications and Installed Software in Resource Explorer?
    Why is this application still showing in the Resource Explorer list when if you look at the machine, it's clearly not installed?

    Collection to find application (two queries):

    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_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "APP%NAME"

    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_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like "APP%NAME"

    Please let me know if any particular logs or information would be useful to help resolve this.

    Wednesday, October 2, 2019 2:24 PM

Answers

  • Hi,

    Based on your description of the problem and the responses from Jason and Richard, please allow me to share some additional information with you:

    If you have enabled hardware inventory, after the client runs a hardware inventory cycle, the client sends the information to the management point in the client's site.
    The management point then forwards the inventory information to the Configuration Manager site server, which then stores the inventory information in the site database.
    Hardware inventory runs on your clients according to the schedule that you specify in client settings(by default, this cycle occurs every seven days).
    We can adjust the frequency at which the client runs the hardware inventory cycle, please see:

    https://docs.microsoft.com/en-us/sccm/core/clients/deploy/about-client-settings#hardware-inventory



    Best regards,
    Larry


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Melophobe123 Thursday, October 3, 2019 2:34 PM
    Thursday, October 3, 2019 9:29 AM

All replies

  • > "The advice online for this particular app is to use a WMI command and then deploy it as a package."

    Don't do this. The advice online is naive and misleading. Using the Win32_Product WMI class is not recommended as it has a major downside that will impact your systems. A quick web search of this class name will net you multiple hits discussing this.

    Installed Applications comes directly from Add/Remove Programs while Installed Software comes from Asset Intelligence (AI). AI uses ARP as a major source of information, but it does some normalization as well as using other possible sources.

    Both come from hardware inventory though so until the systems perform their hardware inventory and send this to the site, the site is unaware of any changes and thus the collections can't reflect the changes and neither can resource explorer as resource explorer is simply of view of what's in the site's DB and not any sort of live view of the systems.


    Jason | https://home.configmgrftw.com | @jasonsandys

    • Proposed as answer by Garth JonesMVP Thursday, October 3, 2019 12:03 AM
    Wednesday, October 2, 2019 3:40 PM
  • Thanks for explaining Installed Applications vs Installed Software 

    Just to confirm, you wouldn't recommend running the following via a package?  

    @echo off
    WMIC product where name="APPNAME" call uninstall /nointeractive


    I don't see what's so harmful about running that via a package?

    Thursday, October 3, 2019 7:45 AM
  • No he wouldn't :)

    at the top of this blog are two links for more information.

    https://home.configmgrftw.com/uninstall-software-en-masse/


    Richard Knight | Collection Refresh Manager | Automate detection rules for patch \ msp files | Twitter

    • Proposed as answer by Garth JonesMVP Thursday, October 3, 2019 10:58 AM
    Thursday, October 3, 2019 8:03 AM
  • Hi,

    Based on your description of the problem and the responses from Jason and Richard, please allow me to share some additional information with you:

    If you have enabled hardware inventory, after the client runs a hardware inventory cycle, the client sends the information to the management point in the client's site.
    The management point then forwards the inventory information to the Configuration Manager site server, which then stores the inventory information in the site database.
    Hardware inventory runs on your clients according to the schedule that you specify in client settings(by default, this cycle occurs every seven days).
    We can adjust the frequency at which the client runs the hardware inventory cycle, please see:

    https://docs.microsoft.com/en-us/sccm/core/clients/deploy/about-client-settings#hardware-inventory



    Best regards,
    Larry


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Melophobe123 Thursday, October 3, 2019 2:34 PM
    Thursday, October 3, 2019 9:29 AM
  • Okay then I'll have a read through that thanks - Would you guys recommend Powershell instead to do this sort of task?

    Thursday, October 3, 2019 10:51 AM
  • Larry - Cheers, yeah this has been over a week or so but I think we have it setup over a shorter time span anyway!
    Thursday, October 3, 2019 10:51 AM
  • I recommend using whatever the native uninstaller is for the application and *not* the Win32_Product WMI class for the reasons given in the blogs. Whether you call that with VBScript, PowerShell, a batch file or anything else is irrelevant.

    Jason | https://home.configmgrftw.com | @jasonsandys

    Thursday, October 3, 2019 2:06 PM
  • When searching for Powershell commands to uninstall an application a huge amount of guides online make use of this "evil" Win32_Product - Does anyone have a solid guide to remove a single application via Powershell without the use of Win32_Product?
    Friday, October 4, 2019 2:29 PM
  • When searching for Powershell commands to uninstall an application a huge amount of guides online make use of this "evil" Win32_Product - Does anyone have a solid guide to remove a single application via Powershell without the use of Win32_Product?
    There is a script that I write within this blog. https://www.enhansoft.com/using-powershell-to-uninstall-applications-with-hardware-inventory/

    Garth Jones

    Blog: https://www.enhansoft.com/blog Old Blog: https://sccmug.ca/

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleashed

    Friday, October 4, 2019 4:27 PM
  • Same answer, call the uninstaller for the product. PowerShell is a scripting language, it doesn't magically do things, it automates them. And in this case, that means automating the calling of the uninstaller for the product in question whatever that may be as there is no universal way to uninstall all applications in Windows. Thus, asking for a PowerShell way to do this is meaningless as it doesn't exist. Yo ucan certainly automate the task with PowerShell, but you can also automate it with VBScript, a batch file, Python, Ruby, etc. 

    Jason | https://home.configmgrftw.com | @jasonsandys

    Saturday, October 5, 2019 8:07 PM
  • Let's say we can't call the uninstaller for a particular product.

    I'd prefer to call the MSI uninstall GUID and based on your advice, get Powershell to call a batch script for example.

    The issue now is the tons of variations of MSI GUID's for the same product (even the same version!)

    Can we export a list using SCCM/Powershell to extract all the GUIDs for an application?

    Monday, October 7, 2019 10:36 AM
  • Also if you wanted to run a batch script to call the uninstaller, the preferred method via SCCM would be a Package correct?

    I notice under Applications > Scripts the only option is Powershell

    Monday, October 7, 2019 10:38 AM
  • Look at the add/remove regkey.

    Garth Jones

    Blog: https://www.enhansoft.com/blog Old Blog: https://sccmug.ca/

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleashed

    Monday, October 7, 2019 11:38 AM
  • If you see above, that's where I'm at now.  But please read above the issue with having 20++ MSI GUIDs for the same product
    Monday, October 7, 2019 12:01 PM
  • If you see above, that's where I'm at now.  But please read above the issue with having 20++ MSI GUIDs for the same product

    And what the problem? If you look at the Script that I posted a link to. It reads the ARP data and uninstall all apps that match the string. What exactly is wrong with that? and It don't use the evil Win32_product wmi class and yes it is powershell. 

    If you are just looking for the Guid for the ARP title you can find them with ARP data both on the workstation or within SCCM ARP sql view. 


    Garth Jones

    Blog: https://www.enhansoft.com/blog Old Blog: https://sccmug.ca/

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleashed

    Monday, October 7, 2019 2:28 PM
  • Also if you wanted to run a batch script to call the uninstaller, the preferred method via SCCM would be a Package correct?

    I notice under Applications > Scripts the only option is Powershell

    It doesn't matter if you use a package or application, both will run a batch file or script. 

    Application scripts is anytype of script, vbs, batch, ps1, etc. 


    Garth Jones

    Blog: https://www.enhansoft.com/blog Old Blog: https://sccmug.ca/

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleashed

    Monday, October 7, 2019 2:32 PM
  • That's why I wrote the script above that RIchard linked to at https://home.configmgrftw.com/uninstall-software-en-masse/

    The script doesn't care if it's an MSI or EXE installer. Read the post for more information.


    Jason | https://home.configmgrftw.com | @jasonsandys

    Monday, October 7, 2019 3:25 PM
  • While I appreciate that you've taken time to create the above script it would still be useful to know if there's a way of gathering the GUID's of a product name on multiple machines in your Domain.

    From what's been said above it sounds like that is in fact a part of your script.  I've opened the script into an Edit and it's quite something! Could you perhaps break that section out for us?

    Tuesday, October 8, 2019 10:00 AM
  • Also when using your script to uninstall Dell SupportAssist as a test I get the following error: Microsoft VBScript runtime error: Object not a collection

    I'm not a VBS person by any stretch as you can tell!

    Tuesday, October 8, 2019 10:04 AM
  • While I appreciate that you've taken time to create the above script it would still be useful to know if there's a way of gathering the GUID's of a product name on multiple machines in your Domain.

    From what's been said above it sounds like that is in fact a part of your script.  I've opened the script into an Edit and it's quite something! Could you perhaps break that section out for us?

    if you have SCCM in place already all the GUIDs are within the db you can see them by running 

    Select * from v_Add_Remove_Programs


    Garth Jones

    Blog: https://www.enhansoft.com/blog Old Blog: https://sccmug.ca/

    Twitter: @GarthMJ Book: System Center Configuration Manager Reporting Unleashed

    Tuesday, October 8, 2019 12:30 PM
  • Do you want to expand on that a little? Let's make it useful information for everyone who reads it.

    "you can see them by running Select * from v_Add_Remove_Programs" doesn't make a great deal of sense.  Are you talking about creating a query with that in the query text? Or is there some sort of quick thing to run that you're referring to?


    Tuesday, October 8, 2019 1:23 PM
  • if there's a way of gathering the GUID's of a product name on multiple machines in your Domain

    ConfigMgr already does this for you with Hardware Inventory.

    The GUID though is simply part of the ARP info in the registry under HKLM\Software\Microsoft\Uninstall (for 64-bit apps on 64-bit OSes and under HKLM\Software\Wow6432Node\Microsoft\Uninstall (which are exactly what my script checks and what ConfigMgr hardware inventory uses as well). 

    You can also use the Windows Installer APIs to get this info as well. It all depends on exactly what your purpose is and none of this is specific to ConfigMgr.


    Jason | https://home.configmgrftw.com | @jasonsandys

    Tuesday, October 8, 2019 1:30 PM