Powershell & Printers

Welcome Forums General PowerShell Q&A Powershell & Printers

Viewing 6 reply threads
  • Author
    Posts
    • #205002
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      Hi all, I’m in a desparate situation and have been trying to figure this out for quite some time.

       

      I need the ability to add printer trays to printers being added through powershell. I also need the ability to set duplexing. There is device settings per each printer, but I don’t know how to set the tray 3 as ‘installed’ and as duplex as ‘installed’.

       

      Any advice?

    • #205032
      Participant
      Topics: 4
      Replies: 90
      Points: 404
      Helping Hand
      Rank: Contributor

      Use the PrintManagement Module.

      Tray Settings:

      Get-PrinterProperty

      Set-PrinterProperty

      Duplexing:

      Get-PrintConfiguration

      Set-PrintConfiguration

       

    • #205047
      Participant
      Topics: 1
      Replies: 1
      Points: 14
      Rank: Member

      I’ve reviewed Microsoft’s documentation on this, and have been unsuccessful. Can you provide an example of each command if that’s not asking for too much?

    • #205233
      Participant
      Topics: 4
      Replies: 90
      Points: 404
      Helping Hand
      Rank: Contributor

      Duplexing Example

      $Server = 'PrintServer'

      $Printer = 'Printer123'

      Get-PrintConfiguration -ComputerName $Server -PrinterName $Printer

      Set-PrintConfiguration -ComputerName $Server -PrinterName $Printer -DuplexingMode TwoSidedLongEdge

    • #205236
      Participant
      Topics: 4
      Replies: 90
      Points: 404
      Helping Hand
      Rank: Contributor

      Print Tray Example

      $Server = 'PrintServer'

      $Printer = 'Printer123'

      Get-PrinterProperty -ComputerName $Server -PrinterName $Printer | Where-Object PropertyName -Match 'tray\d_install'

      Set-PrinterProperty -ComputerName $Server -PrinterName $Printer -PropertyName Config:Tray4_install -Value "INSTALLED"

    • #215130
      Participant
      Topics: 0
      Replies: 1
      Points: 6
      Rank: Member

      Hi Guys,

      I need to ask about expanding such query. I need to check and possibly set -PaperSize for trays in printer.

      $Printer = "my_printer"
      Get-PrinterProperty -printername $printer | where {$_.PropertyName -like "*config:tray*"} | ft -AutoSize
    • #216507
      Participant
      Topics: 3
      Replies: 340
      Points: 1,120
      Helping Hand
      Rank: Community Hero

      Hi DrumSand,

       

      Check and set to what?

Viewing 6 reply threads
  • You must be logged in to reply to this topic.