Update the configuration of an existing printer.
Syntax
Set-Printer [-Name] String [-Comment String] [-DriverName String] [-PortName String]
[-ComputerName String] [-CimSession CimSession[]] [-Datatype String]
[-KeepPrintedJobs] [-Location String] [-PermissionSDDL String] [-PrintProcessor String]
[-Priority UInt32] [-Published] [-RenderingMode RenderingModeEnum]
[-SeparatorPageFile String] [-Shared] [-ShareName String]
[-StartTime UInt32] [-UntilTime UInt32] [-WorkflowPolicy WorkflowPolicyEnum]
[-BranchOfficeOfflineLogSizeMB UInt32] [-DisableBranchOfficeLogging]
[-ThrottleLimit Int32] [-AsJob] [-PassThru]
[-WhatIf] [-Confirm] [CommonParameters]
Set-Printer -InputObject CimInstance[] [-Comment String] [-DriverName String] [-PortName String]
[-CimSession CimSession[]] [-Datatype String]
[-KeepPrintedJobs] [-Location String] [-PermissionSDDL String] [-PrintProcessor String]
[-Priority UInt32] [-Published] [-RenderingMode RenderingModeEnum]
[-SeparatorPageFile String] [-Shared] [-ShareName String]
[-StartTime UInt32] [-UntilTime UInt32] [-WorkflowPolicy WorkflowPolicyEnum]
[-BranchOfficeOfflineLogSizeMB UInt32] [-DisableBranchOfficeLogging]
[-ThrottleLimit Int32] [-AsJob] [-PassThru]
[-WhatIf] [-Confirm] [CommonParameters]
Key
-Name
The name of the printer to modify.
-AsJob
Run the cmdlet as a background job.
Use this parameter to run commands that take a long time to complete.
-BranchOfficeOfflineLogSizeMB
The maximum size, in megabytes, of the branch office remote offline log file for this printer.
You cannot specify this parameter for unshared queues or queues without branch office enabled.
-CimSession
Run 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.
-Comment
Text to add to the Comment field for the specified printer.
-ComputerName
The name of the computer on which the printer is installed.
-Confirm
Prompt for confirmation before executing the command.
-Datatype
The data type the printer uses to record print jobs..
-DisableBranchOfficeLogging
Indicates that branch office remote logging is disabled.
You cannot specify this parameter for unshared queues.
-DriverName
The name of the printer driver for the printer.
-InputObject
Specifies the input object that is used in a pipeline command.
-KeepPrintedJobs
Whether the print jobs in the queue are kept. Default=No/False.
-Location
The location of the printer (text string).
-PassThru
Return an object representing the item with which you are working.
By default, this cmdlet does not generate any output.
-PermissionSDDL
Permissions for the printer as a Security Descriptor Definition Language (SDDL) string.
-PortName
The name of the port that is used or created for the printer.
-PrintProcessor
The name of the print processor used by the printer.
-Priority
The relative queue priority. Possible values are from 1 through 99. The default is 1.
Higher numbers will get a higher priority, but will not interrupt an in-progress lower priority job.
-Published
Whether the printer is published in the network directory service.
-RenderingMode
The rendering mode for the printer. One of the following modes:
SSR - Server Side Rendering
CSR - Client Side Rendering
BranchOffice - Branch Office
-SeparatorPageFile
The path of and name of the separator page to be used by the printer.
-Shared
Indicates whether to share the printer on the network.
To set the name by which the printer is shared specify -ShareName.
If -ShareName is not specified, the Name of the printer is used as the share name.
-ShareName
The name by which to share the printer on the network.
To share a printer, specify the -Shared parameter.
-StartTime
The starting time of printer availability.
-ThrottleLimit
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 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.
-UntilTime
The ending time of printer availability.
-WorkflowPolicy
Enables an administrator to associate a given printer with a specific Workflow application.
This parameter does not allow the administrator to override the device-app association that
was made using the device metadata service.
-WhatIf
Describe what would happen if you executed the command without
actually executing the command.
The Add-Printer cmdlet adds a printer to a specified computer. You can add both local printers and connections to network-based printers. Printer Connections to remote printers are made for the current user account only.
Branch Office Direct Printing can reduce Wide Area Network (WAN) usage by printing directly to a print device instead of a server print queue.
Set printer to keep printed jobs:
PS C:\> Set-Printer -Name "Microsoft XPS Document Writer" -KeepPrintedJobs $True
Set printer to keep printed jobs by using a printer object:
PS C:\> $Printer = Get-Printer -Name "Microsoft XPS Document Writer"
PS C:\> $Printer.KeepPrintedJobs = $True
PS C:\> Set-Printer -InputObject $Printer
“We are the children of a technological age. We have found streamlined ways of doing much of our routine work. Printing is no longer the only way of reproducing books. Reading them, however, has not changed” ~ Lawrence Clark Powell.
Get-Printer - Retrieve a list of printers installed on a computer.
Add-Printer - Add a printer to a computer.
Add-PrinterDriver - Install a printer driver on the computer.
Set-PrintConfiguration - Update the configuration information of a printer.
Remove-Printer - Remove a printer from the specified computer.
Get-PrintJob - Retrieve a list of print jobs from the specified printer.