Question regarding LPR print port creation using POWERSHELL

Anonymous
2021-07-02T07:51:46.323+00:00

Hello Microsoft team,

I had a query regarding LPR port creation using powerhsell,
I have went through the commands for creating LPR port using powershell for example as below

add-printerport -Name "10.10.10.10" -lprhostaddress "10.10.10.10" -lprbytecounting -lprqueuename "PTSTPRNTR"

When i execute this command the port is getting created under TCP/IP Printer port monitor only with LPR option.
But i need a LPR printer port that needs to be created under LPR printer port only.

  1. I need a LPR port that needs to be created as in Screenshot 1 which is actually a correct one and the port needs to be created with 10.10.10.10:PTSTPRNT format where 10.10.10.10 is a host address and PTSTPRNT is a printer name or queue name.(This port in screenshot 1 created manually by selection LPR option)
    111302-screenshot1.png
  2. But when LPR command as add-printerport -Name "10.10.10.10" -lprhostaddress "10.10.10.10" -lprbytecounting -lprqueuename "PTSTPRNTR"
    is executed, LPR port is creating under TCP/IP port monitor as shown in screenshot 2. (Screenshot 2 port is created using command)

    111313-screenshot2.png In Screenshot 3 -> You can see the configuration of screenshot 2, Its with LPR option selected but as we can see in screenshot 2 Its under TCP/IP Port monitor only.
    111278-screenshot3.png
    Please advice on how we can create a LPR port as shown in screenshot 1.

Thanks and regards,
Swaroop Ramesh

Windows Server Printing
Windows Server Printing
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Printing: Printer centralized deployment and management, scan and fax resources management, and document services
640 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leila Kong 3,691 Reputation points
    2021-07-05T02:22:16.027+00:00

    Hello @Anonymous ,

    Thanks for your query.

    1.Your powershell command "lprhostaddress", "lprbytecounting" and "lprqueuename" are used when installing a TCP/IP printer port in LPR mode.
    Add-PrinterPort: https://learn.microsoft.com/en-us/powershell/module/printmanagement/add-printerport?view=windowsserver2019-ps

    2.Please try the following command: Add-PrinterPort -ComputerName PrintServer -PrinterName $printer -HostName 'PrinterHostName'
    Quick Tip - Create New LPR Printers Using PowerShell: https://thomasrayner.ca/quick-tip-create-new-lpr-printers-using-powershell/

    Best regards,
    Leila


    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful