Win32Reg_AddRemovePrograms not listing all installed programs

Welcome Forums General PowerShell Q&A Win32Reg_AddRemovePrograms not listing all installed programs

This topic contains 9 replies, has 6 voices, and was last updated by

 
Participant
1 month ago.

  • Author
    Posts
  • #112411

    Participant
    Points: 0
    Rank: Member

    Doing something like this:

    Get-WmiObject -Class Win32Reg_AddRemovePrograms -Computer System1

    Doesn't list all the programs installed, however, if I use the registry I get them all plus a TRUCKLOAD more, not just the ones showing in Control Panel under "Programs and Features", any clues?

    Thanks

  • #112420

    Keymaster
    Points: 7
    Rank: Member

    That's just the way that particular class was written. It's kind of always been that way. Win32_Product does the same thing – it's due in part to the fact that different applications register themselves differently, and ones not in the Windows Installer database will usually be missed.

  • #112436

    Participant
    Points: 25
    Rank: Member

    It is highly recommended that you do NOT use WMI to get installed software. Check out the following blog:

    https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/15/use-powershell-to-find-installed-software/

    There are other blogs out there that go into detail of all the reasons NOT to use Win32_Product or other repositories.

    • #112438

      Participant
      Points: 0
      Rank: Member

      Hi,

      I'm not using Win32_Product, that's a no-no, but Win32Reg_AddRemovePrograms, and apparently getting installed software still remains tricky.

      Thanks guys.

  • #112441

    Participant
    Points: 19
    Rank: Member

    The most reliable method, generally speaking, is to query the registry directly looking for uninstall strings. Most applications will register some kind of uninstall string to allow users to uninstall the software via Control Panel, so you can follow the breadcrumbs from there. 🙂

    • #112442

      Participant
      Points: 0
      Rank: Member

      Indeed, using the registry seems the way to go, however, is also annoying since you get a list of software NOT listed in Control Panel (e.g. Windows updates)

  • #112466

    Participant
    Points: 0
    Rank: Member

    You can check with PackageManagement and perform some filtering. It might help you out.

    • #112472

      Participant
      Points: 0
      Rank: Member

      Actually that's a great idea, however, it requires PSRemoting and in my environment the All-knowing-all-wise Security Team frown upon that, don't ask me why.

      But thank you for that tip.

  • #112474

    Participant
    Points: 65
    Published
    Rank: Member

    Using win32_Product is not recommended as Rob mentioned. I would echo what Joel mentioned , you can browse through registry and is the most successful approach ever for this.I suggest iterating trough both 64bit and 32bit paths.

    You can use this script form TechNet script repository.

    • #112475

      Participant
      Points: 0
      Rank: Member

      My script works fine and I'm using the registry, I get all the installed software, my question was only if there was a way to improve the results, meaning, to show only the same software listed in Control Panel, the cmdlet Get-Package can be used but not without having PSRemoting enabled.

You must be logged in to reply to this topic.