We have a number of 32-bit Windows 2008 print servers that we want to migrate to Windows Server 2012, for the printer management PowerShell cmdlets, among other things. I found a helpful blog post about using the PRINTBRM utility to migrate print queues, which mentions that you need to have both 32-bit and 64-bit drivers versions of all the drivers in order to migrate from a 32-bit to a 64-bit OS instance.
I wrote a little script to quickly show me which print drivers need a 64-bit version installed. It can take a moment to run if you have many printers configured.
<#
.SYNOPSIS
Lists printer drivers, whether 32- and 64-bit versions are installed,
and how many printers are using each driver.
.EXAMPLE
PS C:\local\scripts> .\Get-PrinterDriverArchitecture.ps1 | format-table -auto
Name x86 x64 Printers
---- --- --- --------
Brother HL-5250DN True False 5
Brother HL-6050D/DN True False
Brother MFC-8890DW Printer True False
Brother PT-18R True False
Epson LQ-570+ ESC/P 2 True False
HP Business Inkjet 2230/2280 True False 1
HP Business Inkjet 2250 (PCL5C) True True
HP Business Inkjet 2800 PCL 5 True False 1
.EXAMPLE
PS C:\local\scripts> .\Get-PrinterDriverArchitecture.ps1 | where x64 -eq $false | ft -a
Name x86 x64 Printers
---- --- --- --------
Brother HL-5250DN True False 5
Brother HL-6050D/DN True False
Brother MFC-8890DW Printer True False
Brother PT-18R True False
Epson LQ-570+ ESC/P 2 True False
HP Business Inkjet 2230/2280 True False 1
HP Business Inkjet 2800 PCL 5 True False 1
HP Business Inkjet 3000 PCL 5 True False
.NOTES
- Author: Geoffrey.Duke@uvm.edu
- Date : May 23, 2013
#>
$wmi_drivers = get-wmiobject Win32_PrinterDriver -Property Name
$drivers = @{}
foreach ($driver in $wmi_drivers) {
# Isolate the driver name and platform
$name,$null,$platform = $driver.Name -split ','
if ( -not $drivers[$name] ) {
switch ( $platform ) {
'Windows NT x86' { $drivers[$name] = [ordered]@{
'Name'=$name; 'x86'=$true; 'x64'=$false }; break }
'Windows x64' { $drivers[$name] = [ordered]@{
'Name'=$name; 'x86'=$false; 'x64'=$true }; break }
default { write-warning "Unexpect platform $platform on driver $name"}
}
}
else {
switch ( $platform ) {
'Windows x64' { $drivers[$name]['x64'] = $true; break }
'Windows NT x86' { $drivers[$name]['x86'] = $true; break }
default { write-warning "Unexpect platform $platform on driver $name"}
}
}
}
# Add a count of the number of printers using each driver
get-wmiobject Win32_Printer -Property DriverName |
foreach { $drivers[$_.DriverName]['Printers']++ }
# Output collection of objects
$drivers.keys | sort | foreach { New-Object PSObject -Property $drivers[$_] }
I hope this is useful to others.