-= deadface.org =-

Home | News | Scripts | #crypt IRC Channel
This is a powershell script which removes and re-adds printers with a different driver. The example below is for Lexmark, to change from the desktop driver to the universal driver, but it can be adjusted to work with any drivers.
$driver = "Lexmark Universal v2"
$pattern = "Lexmark*Class*"

$printers = Get-Printer | where { $_.DriverName -like $pattern }

foreach ($printer in $printers) {
  Remove-Printer -InputObject $printer
  Add-Printer -Name $printer.name `
    -DriverName $driver `
    -PortName $printer.PortName `
    -Location $printer.Location `
    -Published -Shared `
    -ShareName $printer.ShareName `
    -Comment $printer.Comment
}

This page is designed to be text-browser compatible.

Valid XHTML 1.0 StrictValid CSS 2.1

Copyright © 2007-2024 deadface.org. All rights reserved.