Adding Internet Port by command line

Paul Rattu 1 Reputation point

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?


Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,818 questions
{count} votes

3 answers

Sort by: Most helpful
  1. S.Sengupta 15,766 Reputation points MVP

    Kindly go through the following Microsoft article:


    0 comments No comments

  2. Paul Rattu 1 Reputation point

    I've gone through that doc, there's nothing in there about adding Internet Ports.

    0 comments No comments

  3. Castorix31 82,116 Reputation points

    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 correctly

    I tested with an address got from Google and my Epson printer to check it :

    rundll32 printui.dll,PrintUIEntry /if /b "Test Printer" /r "" /m "EPSON XP-510 Series"  
    0 comments No comments