Set-PrintConfiguration
Set-PrintConfiguration
Sets the configuration information for the specified printer.
構文
Parameter Set: PrintConfigObject
Set-PrintConfiguration [-InputObject] <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: PrinterName
Set-PrintConfiguration [-PrinterName] <String> [-AsJob] [-CimSession <CimSession[]> ] [-Collate <Boolean> ] [-Color <Boolean> ] [-ComputerName <String> ] [-DuplexingMode <DuplexingModeEnum> ] [-PaperSize <PaperSizeEnum> ] [-PrintTicketXml <String> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: PrinterObject
Set-PrintConfiguration [-PrinterObject] <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-Collate <Boolean> ] [-Color <Boolean> ] [-DuplexingMode <DuplexingModeEnum> ] [-PaperSize <PaperSizeEnum> ] [-PrintTicketXml <String> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
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 using 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 privileges to use Set-PrintConfiguration.
パラメーター
-AsJob
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-CimSession<CimSession[]>
リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。
エイリアス |
Session |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Collate<Boolean>
Specifies whether or not to collate the output of the printer by default.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Color<Boolean>
Specifies whether the printer should use either color or grayscale printing by default.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-ComputerName<String>
Specifies the name of the computer on which the printer is located.
エイリアス |
Computer,CN |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue, ByPropertyName) |
ワイルドカード文字を許可する |
false |
-DuplexingMode<DuplexingModeEnum>
Specifies the duplexing mode the printer uses by default.
エイリアス |
Duplex,Duplexing |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-InputObject<CimInstance>
Specifies the object which contains the printer configuration settings to set.
エイリアス |
ConfigObject |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue, ByPropertyName) |
ワイルドカード文字を許可する |
false |
-PaperSize<PaperSizeEnum>
Specifies the paper size the printer uses by default.
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PrintTicketXml<String>
Specifies the print ticket XML defining the default print settings for this printer.
エイリアス |
PrintTicket,PT |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-PrinterName<String>
Specifies the printer on which to set the configuration information.
エイリアス |
PN |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue, ByPropertyName) |
ワイルドカード文字を許可する |
false |
-PrinterObject<CimInstance>
Specifies the object which contains the printer on which to change the configuration settings.
エイリアス |
Printer |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
True (ByValue, ByPropertyName) |
ワイルドカード文字を許可する |
false |
-ThrottleLimit<Int32>
このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0
を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。
エイリアス |
なし |
必須? |
false |
位置は? |
named |
既定値 |
なし |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_Printer
This cmdlet accepts one printer object.
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
- This cmdlet produces no output objects.
例
Example 1: Set the default paper size
This command sets the default paper size of the printer named "Microsoft XPS Document Writer" printer to A4.
PS C:\> Set-PrintConfiguration –PrinterName "Microsoft XPS Document Writer" -PaperSize A4
Example 2: Set the default paper size using print configuration object
This set of commands retrieves a print configuration object into a variable ($PrintConfiguration) using Get-PrintConfiguration, sets the paper size in the printer configuration object to A4 and then passes the contents of the variable to Set-PrintConfiguration.
PS C:\> $PrintConfiguration = Get-PrintConfiguration –PrinterName "Microsoft XPS Document Writer"
PS C:\> $PrintConfiguration.paperSize = A4
PS C:\> Set-PrintConfiguration –InputObject $PrintConfiguration
Example 3: Set the default paper size of all printers
This command gets all the printers into a variable $printers and then loops through all the printers and displays the properties.
PS C:\> $printers = get-printer * foreach ($printer in $printers){ Set-printconfiguration –printerName $printer.name -PaperSize A4}