Quantcast
Viewing all articles
Browse latest Browse all 21975

Find Installed Software - Not displaying computer name

Chaps.

I found this script kicking around on the internet which fits my needs in terms of finding all software installed or being specfic and finding say just Acrobat.

The issue is that the .CSV never contains the computer name. I have been trying to troubleshoot this but am at a loss. Any ideas?

[CODE]

$erroractionpreference = "SilentlyContinue"

# The directory to put your csv file of results.
# You can use a UNC path to a share if you like
$outputDir = "S:\software.csv"

# Path to your txt file with a list of computers and testing to see if it's online
Write-Host -fore Yellow "Checking for computers that are online, this may take a while for many machines."
$arrComputers = get-Content -Path "S:\computers.txt" | Where-Object {Test-Connection -ComputerName $_ -Quiet -Count 2}


# What software are you searching for?
# % is the wildcard
Write-Host
Write-Host "Type the name of the software you're looking for. (ex. McAfee% or Windows%)"
$filter = Read-host "The % sign is the wildcard character."
    if (!$filter) {
        Write-Host -fore Red "No filter set, stopping script!"
        Break
    }

$(foreach ($strComputer in $arrComputers){
    get-wmiobject -Class win32_product -computername $strComputer -Filter "Name like '$filter'" |
    Select PScomputername, Name, Version, InstallDate

    foreach ($objItem in $colItems){
        $objItem.PSComputerName
        $objItem.Name
        $objItem.Version
        $objItem.InstallDate
     }
 }) | Export-csv -notypeinformation $outputDir
 Write-Host
 Write-Host -fore Yellow "Script Complete"

[/CODE]


Viewing all articles
Browse latest Browse all 21975

Trending Articles