Home » PowerShell » Set Printer Configuration Using PowerShell

Set Printer Configuration Using PowerShell

The `Set-PrinterConfiguration` cmdlet in PowerShell is used to set the printer configuration for the specified printer. Using the Set-PrinterConfiguration command, you can change the paper size, color, duplexing mode, and N-Up.

Here is the PowerShell syntax to use Set-PrinterConfiguration.

Set-PrintConfiguration
   [-Collate <Boolean>]
   [-Color <Boolean>]
   [-DuplexingMode <DuplexingModeEnum>]
   [-PaperSize <PaperSizeEnum>]
   [-PrintTicketXml <String>]
   [-ComputerName <String>]
   [-PrinterName] <String>
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

You need administrator privileges to use the Set-PrinterConfiguration cmdlet to avoid access-denied issues.

In this article, we will discuss how to use the Set-Configuration cmdlet to set the default paper size for the specified printer, set the default color mode for printing, and set the default duplexing mode.

How to Set the Default Paper Size Using PowerShell

To set the default paper size using the PowerShell, use the Set-PrinterConfiguration command. The Set-PrinterConfiguration cmdlet has a –PaperSize parameter to specify the wide range of paper sizes available such as Custom, A3, A4, A5, B4, Letter, etc…

 Set-PrintConfiguration -PrinterName "Follow-Me-HP" -PaperSize A4

In the above PowerShell script, the Set-PrinterConfiguration cmdlet uses the PrinterName parameter to specify the name of the printer “Follow-Me-HP” and the PaperSize parameter to specify the paper size the printer uses by default.

The output of the above PowerShell that sets the default paper size to A4 for the specified printer name “Follow-Me-HP” is given below.

Set Default Paper Size in PowerShell
Set Default Paper Size in PowerShell

You can use the Get-PrinterConfiguration cmdlet to check the paper size updated for the specified printer or not using the following code.

Get-PrintConfiguration -PrinterName "Follow-Me-HP" | Select-Object papersize

How to Set the Paper Color Using PowerShell

The Set-PrinterCofiguration cmdlet uses the Color parameter to specify the default color mode for printing. The value can be True or False.

  • True: Sets the default color mode to color printing.
  • False: Sets the default color mode to black and white printing

The following PowerShell script will set the default color mode to color printing for the specified printer.

Set-PrintConfiguration -PrinterName "Follow-Me-HP" -Color $True 

In the above PowerShell script, the $True variable has a True value that is used to set the color mode to color printing for the specified printer “Follow-Me-HP“.

The following command will set the default color mode to black and white printing for the specified printer.

Set-PrintConfiguration -PrinterName "Follow-Me-HP" -Color $False

If you don’t specify the -Color parameter, the default color mode will be inherited from the printer driver.

How to Set Default Duplexing Mode Using PowerShell

The Set-PrinterConfiguraton command in PowerShell can be used to set the default duplexing mode for printing. The DuplexingMode parameter specifies the default duplexing mode for printing. The value can be one of the following:

  • OneSided: Prints on the one side of the paper only.
  • TwoSidedLongEdge: Prints on both sides of the paper, with the long edge of the paper feeding through the printer twice.
  • TwoSidedShortEdge: Prints on both sides of the paper, with the short edge of the paper feeding through the printer twice.

The following PowerShell script will set the default duplexing mode to one-sided printing.

Set-PrintConfiguration -PrinterName "Follow-Me-HP" -DuplexingMode OneSided  

In the above PowerShell script, the Set-PrinterConfiguration cmdlet uses the PrinterName parameter to specify the printer name “Follow-Me-HP” and the DuplexingMode parameter to specify the mode for printing as “OneSided“.

The output of the above PowerShell script sets the default duplexing mode OneSided to the specified printer “Follow-Me-HP“.

To set the default duplexing mode to two-sided long edge printing, run the following command.

Set-PrintConfiguration -PrinterName "Follow-Me-HP" -DuplexingMode TwoSidedLongEdge

To set the default duplexing mode to two-sided short edge printing, run the following command.

Set-PrintConfiguration -PrinterName "Follow-Me-HP" -DuplexingMode TwoSidedShortEdge

Conclusion

I hope the above article on how to set the printer configuration such as paper size, color, and duplexing mode for printing using the Set-PrinterConfiguration command in PowerShell is helpful to you.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.