Joep
Joep

Reputation: 39

Get list of installed software of remote computer

Is it possible to get a list of installed software of a remote computer ? I know to do this for a local computer with use of Powershell. Is it possible with Powershell to get installed software of a remote computer and save this list on the remote computer ? This I use for local computers: Get-WmiObject -Class Win32_Product | Select-Object -Property Name

Thanks in advance, Best regards,

Upvotes: 2

Views: 110383

Answers (3)

js2010
js2010

Reputation: 27423

No one seems to know about get-package in powershell 5.1. You'll have to use invoke-command to run it on a remote computer.

get-package | more

Name                           Version          Source                 ProviderName
----                           -------          ------                 ------------
7-Zip 21.07 (x64)              21.07                                   Msi
Wolfram Extras 11.0 (5570611)  11.0.0                                  Programs
ArcGIS Desktop Background G... 10.8.12790                              Programs
# and so on...

msi provider uninstall:

get-package *chrome* | uninstall-package

programs provider uninstall varies:

get-package *notepad++* | % { & $_.metadata['uninstallstring'] /S }

Upvotes: 0

Anthony Stringer
Anthony Stringer

Reputation: 2001

This uses Microsoft.Win32.RegistryKey to check the SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall registry key on remote computers.

https://github.com/gangstanthony/PowerShell/blob/master/Get-InstalledApps.ps1

*edit: pasting code for reference

function Get-InstalledApps {
    param (
        [Parameter(ValueFromPipeline=$true)]
        [string[]]$ComputerName = $env:COMPUTERNAME,
        [string]$NameRegex = ''
    )
    
    foreach ($comp in $ComputerName) {
        $keys = '','\Wow6432Node'
        foreach ($key in $keys) {
            try {
                $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $comp)
                $apps = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall").GetSubKeyNames()
            } catch {
                continue
            }

            foreach ($app in $apps) {
                $program = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall\$app")
                $name = $program.GetValue('DisplayName')
                if ($name -and $name -match $NameRegex) {
                    [pscustomobject]@{
                        ComputerName = $comp
                        DisplayName = $name
                        DisplayVersion = $program.GetValue('DisplayVersion')
                        Publisher = $program.GetValue('Publisher')
                        InstallDate = $program.GetValue('InstallDate')
                        UninstallString = $program.GetValue('UninstallString')
                        Bits = $(if ($key -eq '\Wow6432Node') {'64'} else {'32'})
                        Path = $program.name
                    }
                }
            }
        }
    }
}

Upvotes: 3

Peter Barnett
Peter Barnett

Reputation: 21

There are multiple ways how to get the list of installed software on a remote computer:

  1. Running WMI query on ROOT\CIMV2 namespace:

    • Start WMI Explorer or any other tool which can run WMI queries.
    • Run WMI query "SELECT * FROM Win32_Product"
  2. Using wmic command-line interface:

    • Press WIN+R
    • Type "wmic", press Enter
    • In wmic command prompt type "/node:RemoteComputerName product"
  3. Using Powershell script:

    • Thru WMI object: Get-WmiObject -Class Win32_Product -Computer RemoteComputerName
    • thru Registry: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table –AutoSize
    • thru Get-RemoteProgram cmdlet: Get-RemoteProgram -ComputerName RemoteComputerName

Source: https://www.action1.com/kb/list_of_installed_software_on_remote_computer.html

Upvotes: 1

Related Questions