Ding QB
asked on
Powershell script to install printer
Hi experts,
Is there Powershell script to install printer with given IP address , driver inf file, printer name ? Thanks.
Is there Powershell script to install printer with given IP address , driver inf file, printer name ? Thanks.
https://docs.microsoft.com /en-us/pow ershell/mo dule/print management /add-print er?view=wi n10-ps
Add-Printer
Add-Printerport
Add-Printerdriver
will do the job
i.e.
Add-Printer
Add-Printerport
Add-Printerdriver
will do the job
i.e.
Add-PrinterDriver -Name "Driver Name" -InfPath you.inf
Add-PrinterPort -Name "TCPPort:" -PrinterHostAddress "192.168.100.100"
Add-Printer -Name "yourprinter" -PortName "TCPPort:"-DriverName "Driver Name"
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
To create the port:
CSCRIPT.EXE //NoLogo portmgr.vbs -a -c \\PC_name -p port_name -h Port_IP -t raw -n 9100 -md
To install a printer on that port:
RUNDLL32.EXE PRINTUI.DLL,PrintUIEntry /r port_name /ii /f %windir%\inf\ntprint.inf
For more info see:
https://www.robvanderwoude.com/2kprintcontrol.php
https://www.robvanderwoude.com/files/addipprn_nt.txt
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cscript