Powershell & Printers

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?

Use the PrintManagement Module.

Tray Settings:

Get-PrinterProperty

Set-PrinterProperty

Duplexing:

Get-PrintConfiguration

Set-PrintConfiguration

 

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?

Duplexing Example

$Server = ‘PrintServer’

$Printer = ‘Printer123’

Get-PrintConfiguration -ComputerName $Server -PrinterName $Printer

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

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”

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

Hi DrumSand,

 

Check and set to what?