Manually:
1. Execute WMI Query in ROOT\CIMV2 Namespace:
– Launch WMI Explorer or any other tool which can run WMI queries.
– Run WMI query: SELECT * FROM Win32_Product
2. Open WMIC Command-line Interface:
– Press WIN+R
– Type “wmic”, press Enter
– In wmic command line tool type: /node:RemoteComputerName product
3. Run This Simple Windows Powershell Script:
– thru WMI object: Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer RemoteComputerName
– thru Windows Registry: Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate
– thru Get-RemoteProgram cmdlet: Get-RemoteProgram -ComputerName RemoteComputerName
4. Use Following Code to Select Specific Columns:
– execute: Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer RemoteComputerName | Select-Object Name, Version, PSComputerName
5. Sort the Results Using the Line Below:
– invoke command: Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer RemoteComputerName | Select-Object Name, Version, PSComputerName | Sort-Object Name
6. The Next Code Helps to Filter Results:
– use it: Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer RemoteComputerName | Select-Object Name, Version, PSComputerName | Where-Object -FilterScript {$_.Name -like “Microsoft*”}
7. Save Results to CSV File:
– run: Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer RemoteComputerName | Select-Object Name, Version, PSComputerName | Export-CSV “c:\file.csv” -Append -NoTypeInformation
8. The Next Step Is to Query Multiple Computers:
– computers from a text file: Get-Content -Path c:\computers.txt | ForEach-Object {Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer $_}
– computers from AD domain: Get-ADComputer -Filter {OperatingSystem -Like ‘Windows 10*’} | ForEach-Object {Get-WmiObject -Namespace ROOT\CIMV2 -Class Win32_Product -Computer $_.Name}