powershell with LPR Command multiple printer

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Xeon Xeon 4 months, 1 week ago.

  • Author
    Posts
  • #64831
    Profile photo of Xeon
    Xeon
    Participant

    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
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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
    Profile photo of Xeon
    Xeon
    Participant

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

  • #66675
    Profile photo of Xeon
    Xeon
    Participant

    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

You must be logged in to reply to this topic.