1
votes

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,

2
Possible duplicate of Check computers for installed program in powershell. There's also stackoverflow.com/q/34135657/62576 that contains relevant information. Please do a search here before posting a new question; chances are quite good that the question has been asked (and answered) here before.Ken White
Get-WmiObject –computername mycomputer -Class Win32_Product | Select-Object -Property Name . I dont think it's a duplicate...but ok , this did the job for me...Joep

2 Answers

3
votes

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
                    }
                }
            }
        }
    }
}
1
votes

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