May 072013
 

This script will take a list of print servers and then query each individual server on the list for the installed print drivers. It will then output a report in csv format of all drivers encountered.

###########################################################################
#
# Query listed print servers and report on all drivers discovered.  
#
# by Robert Hollingshead
# Contributed to the public domain. Do with it what you will. 
#
###########################################################################

# Place your server list CSV file here, including path. 
$ServerCSV = "{output csv and path}"

# Place the output CSV file here, including path. 
$OutputCSV = "{output csv and path}"

#Change nothing below this line. 

$credential = Get-Credential
$driver = ""
[system.array]$report = $null

$servers = Import-Csv $ServerCSV

foreach ($server in $servers) 
{

    Write-Host ' ' 
    Write-Host $server.Servername -NoNewLine

    $drivers = Get-WMIObject -class Win32_PrinterDriver -computer $server.Servername -credential $credential

    foreach($driver in $drivers) 
    {

        Write-Host "." -NoNewLine

        $path = $driver.DriverPath.Substring(0,1)

        $output = New-Object PSObject
        $output | Add-Member -membertype noteproperty -Name Servername -Value $server.Servername
        $output | Add-Member -membertype noteproperty -Name Drivername -Value $driver.Name

        $servername = $server.Servername

        $output | Add-Member -membertype noteproperty -Name Driverversion -Value (Get-ItemProperty ($driver.DriverPath.Replace("$path`:","\\$servername\$path`$"))).VersionInfo.ProductVersion

        $report = $report + $output

    }

}

$report | export-csv $OutputCSV -notype