SOLVED: PowerShell Script To List All Software Installed

We had a client who needed to know exactly what was installed on all of their servers in an effort to prepare for an audit. This client is quite small and only had about a dozen servers so instead of writing a script that remotely logs into each server and creates a list, we decided it was faster to use a simple script that we run locally on each server one by one.



# Create C:\TEMP directory If It Does Not Exist
$directory = "C:\temp"
if (-not (Test-Path -Path $directory)) {
    New-Item -ItemType Directory -Path $directory
}

# Export Installed Software List to CSV
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
    Where-Object { $_.DisplayName } |
    Sort-Object DisplayName |
    Export-Csv -Path "$directory\Software.csv" -NoTypeInformation

If you do not want the script to output to C:\TEMP\SOFTWARE.CSV, and you only want it to display the information on the screen, you can using this simple version:

# Get installed software and sort by display name
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* |
    Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
    Where-Object { $_.DisplayName } |
    Sort-Object DisplayName |
    Format-Table -AutoSize

We hope this helps you!


Published by
Ian Matthews

This website uses cookies.