powershell with LPR Command multiple printer

Welcome Forums General PowerShell Q&A powershell with LPR Command multiple printer

This topic contains 3 replies, has 2 voices, and was last updated by

 
Participant
1 year, 9 months ago.

  • Author
    Posts
  • #64831

    Participant
    Points: 0
    Rank: Member

    Hi,
    I am New in PowerShell, and i am trying to get this working, from a machine i would like to print the same file on multiple printer,
    so i used this Command to send the print to only a printer, and its works
    lpr -S Printeripadress -P raw filetoprint.txt
    i would like to create a text file with the ip of all the printer that i have,
    and send the print to this printer list. one after the other.
    Please Help 🙂

  • #64834

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    foreach ($name in (Get-Content names.txt)) { assumes names.txt is one name per line
    lot -S $name -P raw filetoprint.txt
    }

    Or something like that, I would imagine.

  • #64846

    Participant
    Points: 0
    Rank: Member

    it works like charm! thank you Very much Mr! and that was very quick!

  • #66675

    Participant
    Points: 0
    Rank: Member

    Hi All, all is good with this script,i am just thinking if it can diplay on the powershell terminal the current ip where the print is going?
    thanks in advance

The topic ‘powershell with LPR Command multiple printer’ is closed to new replies.