Editéieren

Deelen iwwer


Set-PrintConfiguration

Sets the configuration information for the specified printer.

Syntax

PrinterObject

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

PrinterName

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

PrintConfigObject

Set-PrintConfiguration
    [-InputObject] <CimInstance>
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-PrintConfiguration cmdlet sets the printer configuration for the specified printer. Using the Set-PrintConfiguration cmdlet, you can manage the configuration of the following features:

  • Collate
  • Color
  • Duplexing Mode
  • N-Up
  • Paper Size

The Set-PrintConfiguration cmdlet also accepts print configuration objects by using the Get-PrintConfiguration cmdlet.

You cannot use wildcard characters with Set-PrintConfiguration. You can use Set-PrintConfiguration in a Windows PowerShell remoting session.

You need administrator credentials to use Set-PrintConfiguration.

Examples

Example 1: Set the default paper size

Set-PrintConfiguration -PrinterName "Microsoft XPS Document Writer" -PaperSize A4

This command sets the default paper size of the printer named Microsoft XPS Document Writer printer to A4.

Example 2: Set the default paper size using print configuration object

$PrintConfiguration = Get-PrintConfiguration -PrinterName "Microsoft XPS Document Writer"
$PrintConfiguration.paperSize = A4
Set-PrintConfiguration -InputObject $PrintConfiguration

The first command gets a printer configuration by using Get-PrintConfiguration. The command stores the result in the $PrintConfiguration variable.

The second command assigns the value A4 to the paperSize property of $PrintConfiguration.

The final command sets the value of the printer configuration to the modified value of $PrintConfiguration.

Example 3: Set the default paper size of all printers

$Printers = Get-Printer * Foreach ($Printer in $Printers){     Set-PrintConfiguration -PrinterName $Printer.name -PaperSize A4}

This command gets all the printers into a variable $Printers and then loops through all the printers and displays the properties.

Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Collate

Specifies whether to collate the output of the printer by default.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PrinterObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrinterName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Color

Specifies whether the printer should use either color or grayscale printing by default.

Parameter properties

Type:Boolean
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PrinterObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrinterName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ComputerName

Specifies the name of the computer on which the printer is located.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Computer, CN

Parameter sets

PrinterName
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DuplexingMode

Specifies the duplexing mode the printer uses by default. The acceptable values for this parameter are:

  • OneSided
  • TwoSidedLongEdge
  • TwoSidedShortEdge

Parameter properties

Type:DuplexingModeEnum
Default value:None
Accepted values:OneSided, TwoSidedLongEdge, TwoSidedShortEdge
Supports wildcards:False
DontShow:False
Aliases:Duplex, Duplexing

Parameter sets

PrinterObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrinterName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Specifies the input object that is used in a pipeline command.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ConfigObject

Parameter sets

PrintConfigObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PaperSize

Specifies the paper size the printer uses by default. For valid values, see the Syntax section.

Parameter properties

Type:PaperSizeEnum
Default value:None
Accepted values:Custom, Letter, LetterSmall, Tabloid, Ledger, Legal, Statement, Executive, A3, A4, A4Small, A5, B4, B5, Folio, Quarto, Sheet10x14, Sheet11x17, Note, Envelope9, Envelope10, Envelope11, Envelope12, Envelope14, CSheet, DSheet, ESheet, EnvelopeDL, EnvelopeC5, EnvelopeC3, EnvelopeC4, EnvelopeC6, EnvelopeC65, EnvelopeB4, EnvelopeB5, EnvelopeB6, EnvelopeItaly, EnvelopeMonarch, EnvelopePersonal, FanfoldUS, FanfoldStandardGerman, FanfoldLegalGerman, ISOB4, JapanesePostcard, Sheet9x11, Sheet10x11, Sheet15x11, EnvelopeInvite, Reserved48, Reserved49, LetterExtra, LegalExtra, TabloidExtra, A4Extra, LetterTransverse, A4Transverse, LetterExtraTransverse, APlus, BPlus, LetterPlus, A4Plus, A5Transverse, B5Transverse, A3Extra, A5Extra, B5Extra, A2, A3Transverse, A3ExtraTransverse, JapaneseDoublePostcard, A6, JapaneseEnvelopeKaku2, JapaneseEnvelopeKaku3, JapaneseEnvelopeChou3, JapaneseEnvelopeChou4, LetterRotated, A3Rotated, A4Rotated, A5Rotated, B4JISRotated, B5JISRotated, JapanesePostcardRotated, JapaneseDoublePostcardRotated, A6Rotated, JapaneseEnvelopeKaku2Rotated, JapaneseEnvelopeKaku3Rotated, JapaneseEnvelopeChou3Rotated, JapaneseEnvelopeChou4Rotated, B6JIS, B6JISRotated, Sheet12x11, JapaneseEnvelopeYou4, JapaneseEnvelopeYou4Rotated, PRC16K, PRC32K, PRC32KBig, PRCEnvelope1, PRCEnvelope2, PRCEnvelope3, PRCEnvelope4, PRCEnvelope5, PRCEnvelope6, PRCEnvelope7, PRCEnvelope8, PRCEnvelope9, PRCEnvelope10, PRC16KRotated, PRC32KRotated, PRC32KBigRotated, PRCEnvelope1Rotated, PRCEnvelope2Rotated, PRCEnvelope3Rotated, PRCEnvelope4Rotated, PRCEnvelope5Rotated, PRCEnvelope6Rotated, PRCEnvelope7Rotated, PRCEnvelope8Rotated, PRCEnvelope9Rotated, PRCEnvelope10Rotated
Supports wildcards:False
DontShow:False

Parameter sets

PrinterObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrinterName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PrinterName

Specifies the printer on which to set the configuration information.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PN

Parameter sets

PrinterName
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PrinterObject

Specifies the object which contains the printer on which to change the configuration settings.

Parameter properties

Type:CimInstance
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Printer

Parameter sets

PrinterObject
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-PrintTicketXml

Specifies the print ticket XML defining the default print settings for this printer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:PrintTicket, PT

Parameter sets

PrinterObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PrinterName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

CimInstance

Outputs

Object