# powershell with LPR Command multiple printer

**URL:** <https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104>\
**Category:** PowerShell Help\
**Created:** [February 20, 2017, 2:26pm UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104 "2017-02-20T14:26:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xeon](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@xeon](https://forums.powershell.org/u/xeon)\
**Post date:** [February 20, 2017, 2:26pm UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104/1 "2017-02-20T14:26:03Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![donj](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/donj/32/137_2.png) [@donj](https://forums.powershell.org/u/donj)\
**Post date:** [February 20, 2017, 2:27pm UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104/2 "2017-02-20T14:27:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![xeon](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@xeon](https://forums.powershell.org/u/xeon)\
**Post date:** [February 20, 2017, 2:56pm UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104/3 "2017-02-20T14:56:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xeon](https://avatars.discourse-cdn.com/v4/letter/x/51bf81/32.png) [@xeon](https://forums.powershell.org/u/xeon)\
**Post date:** [March 17, 2017, 9:05am UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104/4 "2017-03-17T09:05:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:39pm UTC](https://forums.powershell.org/t/powershell-with-lpr-command-multiple-printer/8104/5 "2024-05-16T20:39:28Z")

</div>


