NAME
Set-Printer
SYNOPSIS
Updates the configuration of an existing printer.SYNTAX
Set-Printer [-Name]
[-BranchOfficeOfflineLogSizeMB ] [-CimSession ] [-Comment
] [-ComputerName ] [-Datatype ] [-DisableBranchOfficeLogging ] [-DriverName
] [-KeepPrintedJobs ] [-Location ] [-PassThru] [-PermissionSDDL ] [-PortName
] [-PrintProcessor ] [-Priority ] [-Published ] [-RenderingMode {SSR | CSR | BranchOffice}] [-SeparatorPageFile
] [-Shared ] [-ShareName ] [-StartTime ] [-ThrottleLimit
] [-UntilTime ] [-Confirm] [-WhatIf] [ ] Set-Printer [-BranchOfficeOfflineLogSizeMB
] [-CimSession ] [-Comment ] [-Datatype
] [-DisableBranchOfficeLogging ] [-DriverName ] [-KeepPrintedJobs ] [-Location
] [-PassThru] [-PermissionSDDL ] [-PortName ] [-PrintProcessor ] [-Priority
] [-Published ] [-RenderingMode {SSR | CSR | BranchOffice}] [-SeparatorPageFile ] [-Shared
] [-ShareName ] [-StartTime ] [-ThrottleLimit ] [-UntilTime ] [-Confirm] [-WhatIf] [
] DESCRIPTION
The Set-Printer cmdlet updates the configuration of the specified printer.
Use the KeepPrintedJobs parameter to make a printer keep printed jobs.You can specify the printer to update by using either a printer object retrieved by the Get-Printer cmdlet, or by
specifying a printer name.You can use wildcard characters with Set-Printer. You can use Set-Printer in a Windows PowerShell remoting session.
You need administrator credentials to run Set-Printer.
PARAMETERS
-BranchOfficeOfflineLogSizeMB [
Specifies 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 that do not have branch office enabled. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? 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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false-Comment [
Specifies the text to add to the Comment field for the specified printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -ComputerName [
Specifies the name of the computer on which the printer is installed. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Datatype [
Specifies the data type the printer uses to record print jobs. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -DisableBranchOfficeLogging [
Indicates whether branch office remote logging is disabled. You cannot specify this parameter for unshared queues. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -DriverName [
Specifies the name of the printer driver for the printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -KeepPrintedJobs [
Specifies whether the printer jobs in the queue are kept. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Location [
Specifies the location of the printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Name
Specifies the name of the printer to modify. Required? true Position? 1 Default value noneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-PassThru [
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -PermissionSDDL [
Specifies the permissions for the printer as an SDDL string. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -PortName [
Specifies the name of the port that is used or created for the printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -PrintProcessor [
Specifies the name of the print processor used by the printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Priority [
Specifies the relative queue priority. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Published [
Specifies whether the printer is published in the network directory service. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -RenderingMode [
Specifies the rendering mode for the printer. The acceptable values for this parameter are:] -- SSR
-- CSR
-- BranchOffice
Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false-SeparatorPageFile [
Specifies the path of and name of the separator page to be used by the printer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -ShareName [
Specifies the name by which to share the printer on the network. To change the share state of a printer, specify the Shared parameter. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Shared [
Specifies whether the printer is shared. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -StartTime [
Specifies the starting time of printer availability. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? 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 PowerShellr 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. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -UntilTime [
Specifies the ending time of printer availability. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false] -Confirm [
Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet. Required? false Position? named Default value false Accept pipeline input? false Accept wildcard characters? false] -WhatIf [
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run. Required? false Position? named Default value false Accept pipeline input? false Accept wildcard characters? false] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_Printer This cmdlet accepts one printer object.OUTPUTS
Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_Printer This cmdlet returns a printer object.Example 1: Set printer to keep printed jobs
PS C:\> Set-Printer -Name "Microsoft XPS Document Writer" -KeepPrintedJobs $True
This command configures the Microsoft XPS Document Writer printer to keep printed jobs.Example 2: 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
The first command gets the printer named Microsoft XPS Document Writer by using the Get-Printer cmdlet. The
command stores the result in the $Printer variable.
The second command assigns a value of $True to the KeepPrintedJobs property of the $Printer object.
The final command sets the value of revised value of $Printer.
RELATED LINKS
Add-Printer
Get-Printer
Remove-Printer
Rename-Printer