Modify Mass Printers with Powershell

I am in need of modifying the print drivers used by about 30 printers on a Windows 2008r2 print server. I can go into each manually and choose a different driver, but I am hoping to use a powershell to automate this process so that when vendors provide updated drivers, the process will go much easier.

I have the following PS out there to retrieve Printer info, but I can't figure out how to change the driver used.

$strComputer = "."

$colItems = get-wmiobject -class "Win32_Printer" -namespace "root\CIMV2" `
-computername $strComputer

foreach ($objItem in $colItems) {
	If ($objItem.Name -eq "PRINTER_NAME") {
      write-host "Attributes: " $objItem.Attributes
      write-host "Availability: " $objItem.Availability
      write-host "Caption: " $objItem.Caption
      write-host "Character Sets Supported: " $objItem.CharSetsSupported
      write-host "Comment: " $objItem.Comment
      write-host "Default: " $objItem.Default
      write-host "Description: " $objItem.Description
      write-host "Driver Name: " $objItem.DriverName
      write-host "Enable BIDI: " $objItem.EnableBIDI
      write-host "Error Cleared: " $objItem.ErrorCleared
      write-host "Error Description: " $objItem.ErrorDescription
      write-host "Error Information: " $objItem.ErrorInformation
      write-host "Extended Detected Error State: " $objItem.ExtendedDetectedErrorState
      write-host "Extended Printer Status: " $objItem.ExtendedPrinterStatus
      write-host "Last Error Code: " $objItem.LastErrorCode
      write-host "Local: " $objItem.Local
      write-host "Location: " $objItem.Location
      write-host "Name: " $objItem.Name
      write-host "Network: " $objItem.Network
      write-host "Port Name: " $objItem.PortName
      write-host "Printer State: " $objItem.PrinterState
      write-host "Printer Status: " $objItem.PrinterStatus
      write-host "Queued: " $objItem.Queued
      write-host "Server Name: " $objItem.ServerName
      write-host "Shared: " $objItem.Shared
      write-host "Share Name: " $objItem.ShareName
      write-host "Spool Enabled: " $objItem.SpoolEnabled
      write-host "Status: " $objItem.Status
      write-host "Status Information: " $objItem.StatusInfo

Open in new window

Who is Participating?
You'll have to use Win32_PrinterDriver class.
It contains a "AddPrinterDriver()" method which should be used to specify path.
theacerbic1Author Commented:
From my understanding this will add a new printer driver to the system, but what I need is the ability to assign the new driver to existing queues already configured on the server.

i.e. Manually you open Print Management, expand to printers, go to the Advanced tab and choose a different driver.

Will this work for that process as well? I just don't want to update 200 print queues manually.
theacerbic1Author Commented:
This resolved part of the issue, but not the root issue
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.