Adding an IPP port via Add-PrinterPort PowerShell command?

Viewed 1410

Does anyone know if there's a way to add an IP printer port via the Add-PrinterPort Powershell command? I was able to add a new printer to a Windows 2016 server that uses an IPP port via GUI, and when I do a "get-printerport | select *" command, here is the info that is listed for the created port:

Caption               : 
Description           : Internet Port
ElementName           : 
InstanceID            : 
CommunicationStatus   : 
DetailedStatus        : 
HealthState           : 
InstallDate           : 
Name                  : https://REDACTED:443/printer 
OperatingStatus       : 
OperationalStatus     : 
PrimaryStatus         : 
Status                : 
StatusDescriptions    : 
ComputerName          : 
PortMonitor           : Internet Port 
PSComputerName        : 
CimClass              : ROOT/StandardCimv2:MSFT_PrinterPort 
CimInstanceProperties : {Caption,Description, ElementName, InstanceID...} 
CimSystemProperties   : Microsoft.Management.Infrastructure.CimSystemProperties

I didn't see any examples in the MS Add-PrinterPort doc that go over adding an IPP port, and my web searches have come up empty. Has anyone been able to figure this out?

Thanks!

3 Answers

Apparently, adding the printer port via Add-PrinterPort is not necessary for an IPP printer (1). Thus, the port type is not implemented in the cmdlet. Adding the printer using the Add-Printer cmdlet will also create the required port.

Add-Printer -Name "Example-p123" -PortName "https://cups.example.com:631/printers/Example-p123" -DriverName "Example Driver Name"

Got this working with batch:

rundll32 printui.dll,PrintUIEntry /if /b "NAME OF PRINTER" /r "URL" /m "Microsoft Enterprise Cloud Print Class Driver"

Not sure if I'm misunderstanding, but wouldn't it just be a TCP port, using 631?

Add-PrinterPort -Name "coolio_bro_im_a_printer" -PrinterHostAddress "url/to/printer" -PortNumber 631

If I'm wrong, please lemme know and clarify for me what I'm missing.

Related