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 (
keys) {
try {
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $comp)
$apps = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall").GetSubKeyNames()
} catch {
continue
}
foreach (
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 =
key -eq '\Wow6432Node') {'64'} else {'32'})
Path = $program.name
}
}
}
}
}
}
Answer from Anthony Stringer on Stack OverflowHow to get a list of software installed on remote computers
Install software remotely using wmic - IT & Tech Careers - Spiceworks Community
powershell - Getting Program Installed List of Remote Computers - Stack Overflow
Get the List of installed softwares on remote computers with PowerShell
How to list installed programs from the Windows command line?
How to list installed programs on Windows with PowerShell?
How to view the list of installed programs in Settings App?
Videos
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 (
keys) {
try {
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $comp)
$apps = $reg.OpenSubKey("SOFTWARE$key\Microsoft\Windows\CurrentVersion\Uninstall").GetSubKeyNames()
} catch {
continue
}
foreach (
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 =
key -eq '\Wow6432Node') {'64'} else {'32'})
Path = $program.name
}
}
}
}
}
}
There are multiple ways how to get the list of installed software on a remote computer:
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"
Using wmic command-line interface:
- Press WIN+R
- Type "wmic", press Enter
- In wmic command prompt type "/node:RemoteComputerName product"
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
Fire up your console and type:
wmic product get name,version
It takes a while, but you'll get the full list of installed programs. WMIC is the console version of Windows Management Instrumentation, available from Windows 2000 and onwards. Following the instructions here and here, you can tell WMIC to output in an XML format, that might be a bit more convenient for you. However just calling wmic product get name will get you a list of application names, that you can easily copy paste to a text editor and convert to spreadsheet format.
Alternatively, enter:
wmic /output:C:\InstallList.txt product get name,version
This will output a TXT file with the list of programs. You can then paste that into a spreadsheet, if you want.
Source: http://helpdeskgeek.com/how-to/generate-a-list-of-installed-programs-in-windows/
Also you can use the csv.xsl file to format the output into a CSV list of results:
wmic /output:C:\InstallList.csv product get /format:csv.xsl
or the htable.xsl file to create an HTML table of results:
wmic /output:C:\InstallList.htm product get /format:hform.xsl
Run wmic product get to get a list of installed software, it should be exactly the same list as add/remove programs.
You can supposedly get it to to output in a specific format, but I haven't tried it.
(Use wmic product get /? to see the parameters including the output formatting, I tried to include it here but the formatting wasn't quite right.)
If you use Windows Vista or Windows 7 and you didn't want install additional software, you can:
- Open a command-line window (Windows + R, CMD.EXE)
- Type
wmic(Enter) - Type
product get name(Enter)
PsInfo from Microsoft/Sysinternals can list all the installed software if you use the -s flag when you run it. You can also use -c to output it as a csv file to use in Excel for example.
C:\> psinfo -s > software.txt
C:\> psinfo -s -c > software.csv
You can use one of the Sysinternals tools PSinfo:
http://technet.microsoft.com/en-us/sysinternals/bb897550
PsInfo v1.77 - Local and remote system information viewer Copyright (C) 2001-2009 Mark Russinovich Sysinternals - www.sysinternals.com
PsInfo returns information about a local or remote Windows NT/2000/XP system.
Usage: psinfo [-h] [-s] [-d] [-c [-t delimiter]] [filter] [\computer[,computer[,..]]|@file [-u Username [-p Password]]]
-u Specifies optional user name for login to remote computer. -p Specifies password for user name. -h Show installed hotfixes. -s Show installed software. -d Show disk volume information. -c Print in CSV format -t The default delimiter for the -c option is a comma, but can be overriden with the specified character. Use "\t" to specify tab. filter Psinfo will only show data for the field matching thefilter. e.g. "psinfo service" lists only the service pack field. computer Direct PsInfo to perform the command on the remote computer or computers specified. If you omit the computer name PsInfo runs the command on the local system, and if you specify a wildcard (\*), PsInfo runs the command on all computers in the current domain. @file PsInfo will run against the computers listed in the file specified.
Issuing
PSinfo -s \\computername
will tell you what is installed on a remote computer.
On an rpm-based Linux distribution, you could run the following:
ssh <user-who-can-run-rpm>@<remote.host> 'rpm -qa | sort'
For a deb-based distribution, pass this to the ssh command:
'dpkg-query -l | sort'
For Gentoo (per a supplied comment from Monksy):
'qpkg -I | sort'
For Solaris:
'pkginfo -i | sort'
And on AIX:
'lslpp -a all | sort'
Duplicate of this question but to answer the question in WMIC use:
wmic /node:server for remote machines.
In Powershell, Get-WMIObject has the -ComputerName parameter allowing you to run the command against a remote computer.
Try: Get-WMIObject -Class Win32_Product -ComputerName RemoteMachine101
I figured out the problem and this is what I did.
First, I added a GPO that to the computer configuration that would accept WMI-In. That fixed the "RPC server is unavailable" response.
Second, I ran an IP scan using Angry IP of all available nodes. Then I exported the list to a CSV file and then modified it so that only the IP addresses showed. I then saved it as a text file.
Next, I created a PowerShell script. The script pulls the IP addresses from the txt file I previously generated. The script will run each IP address and save the results of each IP in a sperate file. Below is the script:
$IPAddress = Get-Content Z:\Installed-Software\ip-addresses.txt
foreach($ComputerName in $IPAddress) {
echo $ComputerName
Get-WmiObject -Class Win32_Product -ComputerName $ComputerName | Select-Object Name, IdentifyingNumber | Export-Csv C:\Installed-Software\$ComputerName-installed-programs.csv }
You could run the scan on an entire subnet but I chose to scan or available nodes and run the script only on those nodes. Since it takes a minute or 2 to generate the results I figured by eliminating all offline nodes it would save some time.
Hope this helps someone. Special thank you to user4317867 for the push.