Software List - Inventory -WMIC Product

~OSD~ 2,126 Reputation points
2021-02-01T09:19:01.593+00:00

Hi,

I am trying to generate a list of the installed software using WMIC Product, but it seems like I am getting one a few items listed with command.
See below screenshot for the installed product (available in Control Panel) and the WMIC Product Output as well as my current Windows version.
What might I am doing wrong?

62412-image.png

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,705 questions
Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,909 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,389 questions
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 32,076 Reputation points
    2021-02-02T16:28:55.127+00:00

    My output is empty / blank, see belwo.

    The example is missing the trailing slash after Uninstall. I get different software lists when I look at the 32/64 bit entries.

    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
    
    Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | sort-object -property DisplayName | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
    

    For a combined view, run this.

    function Analyze( $p, $f) {
        Get-ItemProperty $p |foreach {
           if (($_.DisplayName) -or ($_.version)) {
                [PSCustomObject]@{ 
                        From = $f;
                        Name = $_.DisplayName;
                        Version = $_.DisplayVersion;
                        Install = $_.InstallDate 
                 }
           } 
        }
    }
    
    $s = @() 
    $s += Analyze 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*' 64
    $s += Analyze 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' 32
    $s | Sort-Object -Property Name 
    

    Instead of WMIC, try Get-CimInstance

    Get-CimInstance Win32_Product | Sort-Object -property Name | Format-Table -Property Version, InstallDate, Name
    

    One behavior I have noticed is that referencing Win32_Product generates an event for each product in the application event log. Check your log. You might be getting an error that is stopping the analysis.

    Log Name: Application
    Source: MsiInstaller
    Date: 2/2/2021 10:06:39 AM
    Event ID: 1035
    Task Category: None
    Level: Information
    Keywords: Classic
    User: SYSTEM
    Computer: slick
    Description:
    Windows Installer reconfigured the product. Product Name: Microsoft SQL Server 2014 Management Objects. Product Version: 12.0.2000.8. Product Language: 1033. Manufacturer: Microsoft Corporation. Reconfiguration success or error status: 0.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Jenny Yan-MSFT 9,326 Reputation points
    2021-02-02T08:19:57.183+00:00

    Hi,
    I guess it might be related that "Win32_Product WMI class represents products as they are installed by Windows Installer. A product generally correlates to one installation package."

    And per further searching, there is also powershell command shared to get installed applications:
    Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize

    Screemshots of my test VM
    62846-image.png

    Reference link:
    https://devblogs.microsoft.com/scripting/use-powershell-to-quickly-find-installed-software/

    ----------

    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny

    0 comments No comments

  2. ~OSD~ 2,126 Reputation points
    2021-02-02T09:00:54.403+00:00

    Hi,

    My output is empty / blank, see belwo.

    62951-image.png