Kindly go through the following Microsoft article:
Adding Internet Port by command line
Hi, I'm trying to figure out how to add a printer using the add-printerport and add-printer commands.
I can add my print server printers manually using the GUI, but I'm not able to do this by command line.
If I run this command I can add a printer but with the wrong port type:
add-printerport -name "Canon2" -printerhostaddress "http://locationofmyprintserver/"
add-printer -name "Canon2" -drivername "Canon iR-ADV C3325/3330 PCL6" -port "Canon2"
When I add the print server by GUI I get the correct port type:
What parameter do I need to set in add-printerport to get it to add the port as Internet Port instead of Standard TCP/IP Port?
Thanks!
3 answers
Sort by: Most helpful
-
-
Paul Rattu 1 Reputation point
2021-08-06T16:06:07.487+00:00 I've gone through that doc, there's nothing in there about adding Internet Ports.
-
Castorix31 86,311 Reputation points
2021-08-06T19:57:31.247+00:00 I did a test with rundll32 printui.dll,PrintUIEntry (How to add printers with no user interaction in Windows)
with an Internet Port and it was added correctlyI tested with an address got from Google and my Epson printer to check it :
rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /r "https://print.concordia.ab.ca/printers/CUCA_PRINT/.printer" /m "EPSON XP-510 Series"