none
Powershell: Install a TCP/IP Printer Port and Printer

    Question

  • Can Powershell Install a TCP/IP Printer (including drivers) to a list of computers?

    We have thousands of printers, in over 100 locations...(Education)

    In a lab setting, that means that someone has to physically touch all 30 or so machines in each room...

    I don't want to re-invent the horse so to speak, and thought for sure, there would be a script already in the library (I am a very new powershell learner).

    Example:  I need to install a HP 4515 to 30 Window's 7 machines.

    Can someone point me in the right direction?  We can't use Group Policy in our environment to accomplish this.  Tech-User has Administrative Rights to the local computers.


    Robin Spitzer

    Thursday, May 30, 2013 12:05 AM

Answers

  • Group Policy is your best bet.  Powershell might be your least best bet as you'd have to configure each machine for the "Execution Policy" and without a Group Policy to make that change you'd still have to touch each machine.  (http://technet.microsoft.com/en-us/library/ee176949.aspx).  There is a Add-Printer command in Powershell 3.0 if that is in fact what the machines are using and if these are networked printers you can then do something like :

    Add-Printer -ConnectionName \\MyPrintServer\HP4515Room30

    Now, lets say you have none of this configured......Then it would be best to go to the old faithful technique of using psexec and printui.dll commands.  Its very well detailed in the technet post below on how you can accomplish this.

    http://blogs.technet.com/b/askperf/archive/2009/02/06/deploying-printers-and-print-drivers-remotely.aspx


    Be kind and Mark as Answer if I helped.

    • Marked as answer by LadyCNE Thursday, May 30, 2013 2:48 AM
    Thursday, May 30, 2013 1:11 AM

All replies

  • Group Policy is your best bet.  Powershell might be your least best bet as you'd have to configure each machine for the "Execution Policy" and without a Group Policy to make that change you'd still have to touch each machine.  (http://technet.microsoft.com/en-us/library/ee176949.aspx).  There is a Add-Printer command in Powershell 3.0 if that is in fact what the machines are using and if these are networked printers you can then do something like :

    Add-Printer -ConnectionName \\MyPrintServer\HP4515Room30

    Now, lets say you have none of this configured......Then it would be best to go to the old faithful technique of using psexec and printui.dll commands.  Its very well detailed in the technet post below on how you can accomplish this.

    http://blogs.technet.com/b/askperf/archive/2009/02/06/deploying-printers-and-print-drivers-remotely.aspx


    Be kind and Mark as Answer if I helped.

    • Marked as answer by LadyCNE Thursday, May 30, 2013 2:48 AM
    Thursday, May 30, 2013 1:11 AM
  • Ok, what if I ran the command, that would eliminate the exec policy issue, I think Now, this has got to be a dumb question, with your example above, I don't have a print server. Just an hp printer with an IP address.. Can I do that command without the \\ Like this? If so that's to simple... Add-Printer -ConnectionName HP4515Room30 Thank you for your time,

    Robin Spitzer

    Thursday, May 30, 2013 2:54 AM
  • I haven't done the powershell command from a Printer that doesn't have a print server but I would assume you can run this command instead but obviously test.

    add-printer -DeviceURL http://1.1.1.1

    http://technet.microsoft.com/en-us/library/hh918353(v=wps.620).aspx

    Be kind and Mark as Answer if I helped.

    Thursday, May 30, 2013 2:00 PM
  • Our Printer Installer (http://www.printerlogic.com/features/direct-ip/?ls=technet20130531c) product will do what you want without the requirement of a print server. Instead of scripting the printer installs, you can specify the printer name, driver, port, device settings, comment, location, etc... and then automatically deploy the printers to members of an IP address range, AD group, user, computer, ou, or container. The product also has a self-service printer installation portal.


    Friday, May 31, 2013 8:45 PM
  • we install printers on our print server then add a local port on client machines then using a program called PDQ deploy we can install driver, local printer port and name printer using the following scripts.

    $Path ="(path to driver)"
    Get-ChildItem -path $path -Recurse | Where-object -property Extension -EQ ".inf" |
    ForEach { PNPUtil.exe -a $PSItem.FullName }

    Add-PrinterDriver -Name "(Name of driver)"

    Add-PrinterPort -Name \\MYserver\Printer

    Add-Printer -DriverName "(drivername)" -Name "(printername)" -PortName "Myserver\Printer"

    Tuesday, June 26, 2018 1:09 PM