r/PowerShell • u/ChanceGuarantee3588 • Apr 23 '26
Question Printer does not respect Set-PrintConfig
Hello,
I am facing an issue. I am trying to print out some documents, some needs to be one sided, some double sided.
However, the prints come out as the driver is set in the dialogue box, not as I set it in powershell.
How to get word/excel to print in a certain duplex mode?
9
Upvotes
6
u/SimpleSysadmin Apr 23 '26
Pretty sure settings in the driver that a user has set will override anything set by set-printconfig by design.
There are some interesting interactions of which print settings take precedence between global defaults, user defaults and current setting for a session, and this can change depending on app.
I don’t know exactly what set-printconfig configures specifically but the issue will be in the logic above. Could also be that ps command only applies to specific driver types too. Printing is a whole thing.
6
u/arslearsle Apr 23 '26
Printers and scanners should be forbidden and externinated from the universe.
Its a shitshow of different vendors, generic drivers, some ok - some others, well maybe not.
Forget one ring to rule them all. Welcome to hell…
And Im talking about the big brands, large multifunction network printers/scanners etc. Home consumer printers, I have no idea.
2
u/Unlikely_Total9374 Apr 23 '26
Respectfully, i think you're in hell trying to manage printing through ps, I wish you the best of luck because you're a braver man than I am
2
u/fosf0r Apr 23 '26 edited Apr 25 '26
edit: I made a better version of this here: https://fosf0r.com/posts/modifying-printer-settings-with-powershell/
Below is the gist. If this doesn't work, then you probably don't have the correct driver type installed. You generally want the PCL6 v4 Universal driver for your device.
Now we have the configuration in
$PrintTicketXML.(You're going to have to dive into your own
$PrintTicketXMLobject to find the setting name and value for your make and model of printer.)Here's some examples I used on an HP Managed Flow MFP printer:
edit: I have successfully deployed the following printers 100% through a single .ps1 file which installs the v4 PCL6 driver with pnputil, installs the icon, creates/updates TCP/IP port, ties the icon to the driver and port, sets things like color or duplexing as mentioned above, and sets it as default or whatever my customer asked for (and most of my .ps1 files also auto-download and auto-unpack the giant .exe file these vendors have you download):
1
u/fosf0r Apr 25 '26
I made a better version of my comment here: https://fosf0r.com/posts/modifying-printer-settings-with-powershell/