This post was most recently updated on February 18th, 2023.
3 min read.This article explains (with conveniently copy-pasteable code samples) how you can query your printers using PowerShell and modify properties, such as paper size, for one or more of them. This is very useful if you have multiple printers and multiple computers that you use. AND if you frequently move between continents, you might face the same, totally typical and widespread issue:
Your favorite printer might default to using “Letter” paper size, but you’d really need to get it printed in that sweet, sweet “A4” instead. And boy, what a mess it is if you forget to change it when you’re printing!
Margins get messed up. It’s the worst.
So, how do you change the default paper size for a printer?
Well, it’s actually really easy to do manually. It’s so easy that I’m not even going to go into the details. Just go to Settings > Printers and scanners > modify the printers one by one.
But you don’t want to change the default paper size by hand every time you move between continents – especially if you have multiple printers and multiple computers. So in comes PowerShell!
Solution
Time needed: 5 minutes
How to change printer paper size using PowerShell?
- Open PowerShell
Should be easy enough. You should have 1 or more different PowerShell versions already installed on your machine, and any of them will do.
Or, if you can’t find it, get it following the directions here:
Installing various versions of PowerShell - Enumerate your printers and see their paper sizes
Okay, easy enough – just run this in your PowerShell instance:
Get-Printer | Get-PrintConfiguration | foreach-object { Write-Host $_.PrinterName: $_.PaperSize }
You COULD also just omit everything after “| foreach-object..”, and get a nicely formatted table – but you won’t get the paper size that way.
Anyway – you should get something like this: - Update the paper size for your printer
Okay – so now we know the printer names and their paper sizes. Let’s set the offending printer straight somewhat like this:
Set-PrintConfiguration -PrinterName "Brother HL-2030 (LPR)" -PaperSize "A4"
Even if you get some access denied errors, it doesn’t mean your change hasn’t gone through. Jump to step 5 to verify! - (OPTIONAL): Update the paper size for ALL of your printers
You can also just set all of your printers to use the proper, German standard paper size. Let’s just make this a one-liner:
Get-Printer | Set-PrintConfiguration -PaperSize A4
- Verify your change was successful
Just run the first thing again, and observe the output:
Get-Printer | Get-PrintConfiguration | foreach-object { Write-Host $_.PrinterName: $_.PaperSize }
That’s it. The above should help you set the default paper size for one or more printers in Windows 10. Use it to switch it between A4 and Letter every week if you wish :)
Happy printing!
Postface
You might’ve noticed the cheeky tone of this article. Well done!
See, I’m sassing myself for spending 5 minutes figuring out the PowerShell to (partially) automate a 1-minute task… And THEN spending 10 minutes documenting it on my blog.
All for a task – printing – that I need to do roughly once a year. Today marked the second time I needed to print since I’ve moved back to Finland in 2019.
Oh well.
And as a side note – if you get these errors:
Have no fear! It’s probably nothing at all. Just verify that the change was successful, and you should be good.
References
- Installing various versions of PowerShell
- Get-PrintConfiguration
- Set-PrintConfiguration
- These guys tried to figure this out, but the thread ain’t open anymore. So here you go.
- “Performing cleanup” – Excel is stuck with an old, conflicted file and will never recover. - November 12, 2024
- How to add multiple app URIs for your Entra app registration? - November 5, 2024
- How to access Environment Secrets with GitHub Actions? - October 29, 2024