Question: You want to set all of your printers with a name like HP to print duplex. How can you do this using Windows PowerShell?
Answer: On Windows 8 or above, use the Get-Printer function to retrieve all HP printers, and pipeline the results to Set-PrintConfiguration. Specify a duplex mode for the printer. This appears here.
Get-Printer -Name *hp* | Set-PrintConfiguration -DuplexingMode TwoSidedLongEdge
Ed Wilson is the bestselling author of eight books about Windows Scripting, including Windows PowerShell 3.0 Step by Step, and Windows PowerShell 3.0 First Steps. He writes a daily blog about Windows PowerShell call Hey, Scripting Guy! that is hosted on the Microsoft TechNet Script Center; for more PowerTips check out the Hey, Scripting Guy! blog.
I ran the following on a Windows 2016 server in a Administrator PowerShell session. I did not receive any errors, however the setting was not updated.
Set-PrintConfiguration -computername s-prt-b11-01 -printername “BBV-OverlandPark01 DUPLEX” -DuplexingMode TwoSidedLongEdge
That’s an old tip given to me by Ed Wilson, don’t know if it still works on recent Windows versions. Suggest asking over on https://powershell.org/forums/