Using PowerShell to install a network printer

Installing a new network printer using Windows PowerShell involves performing the following steps:

  1. Installing a printer driver for the new printer

  2. Creating a Standard TCP/IP Port for the printer

  3. Installing the printer using the driver and port specified

  4. Performing any additional configuration needed for the printer

For example, let’s say you want to install a printer that uses the Dell Color Laser PCL6 Class Driver on your print server. You could begin by using the Add-PrinterDriver cmdlet to install the printer driver on the server:

PS C:\> Add-PrinterDriver -ComputerName HOST7 -Name “Dell Color Laser PCL6 Class Driver”

Next, you could use the Add-PrinterPort cmdlet to add a new port for the printer like this:

PS C:\> Add-PrinterPort -ComputerName HOST7 -Name “172.16.11.63” `
-PrinterHostAddress “172.16.11.63”

Next, you could use the Add-Printer cmdlet to install, name, and share the new printer using the driver and port previously specified as follows:

PS C:\> Add-Printer -ComputerName HOST7 -Name “Sales Printer” `
-DriverName “Dell Color Laser PCL6 Class Driver” -Shared `
-ShareName “SalesPrint” -PortName “172.16.11.63”

Finally, you might want to change the default paper size for the new printer from Letter to Legal like this:

PS C:\> Set-PrintConfiguration -ComputerName HOST7 -PrinterName “Sales Printer” `
-PaperSize Legal

The above tip was excerpted from Mitch Tulloch’s book Training Guide: Installing and Configuring Windows Server 2012 from Microsoft Press.

Mitch is a nine-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows administration, deployment and virtualization.  For more information see http://www.mtit.com.

About The Author

1 thought on “Using PowerShell to install a network printer”

  1. It seem the script doesn’t need driver files. Is that correct.
    If it does need the drivers files , how do provide that?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top