Learn how to a build a cloud-first strategyRegister Now


Modify Mass Printers with Powershell

Posted on 2011-10-10
Medium Priority
Last Modified: 2012-05-12
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

Question by:theacerbic1
  • 2
LVL 11

Expert Comment

ID: 36947643
You'll have to use Win32_PrinterDriver class.
It contains a "AddPrinterDriver()" method which should be used to specify path.


Author Comment

ID: 36948001
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.
LVL 26

Accepted Solution

e_aravind earned 375 total points
ID: 36948091

Author Closing Comment

ID: 37030711
This resolved part of the issue, but not the root issue

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question