external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|
MSFT_Printer_v1.0.cdxml-help.xml |
PrintManagement |
10/29/2017 |
2.0.0 |
Set-Printer |
Updates the configuration of an existing printer.
Set-Printer [-Name] <String[]> [-ComputerName <String>] [-Comment <String>] [-Datatype <String>]
[-DriverName <String>] [-UntilTime <UInt32>] [-KeepPrintedJobs <Boolean>] [-Location <String>]
[-PermissionSDDL <String>] [-PortName <String>] [-PrintProcessor <String>] [-Priority <UInt32>]
[-Published <Boolean>] [-RenderingMode <RenderingModeEnum>] [-SeparatorPageFile <String>] [-Shared <Boolean>]
[-ShareName <String>] [-StartTime <UInt32>] [-DisableBranchOfficeLogging <Boolean>]
[-BranchOfficeOfflineLogSizeMB <UInt32>] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob]
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Set-Printer -InputObject <CimInstance[]> [-Comment <String>] [-Datatype <String>] [-DriverName <String>]
[-UntilTime <UInt32>] [-KeepPrintedJobs <Boolean>] [-Location <String>] [-PermissionSDDL <String>]
[-PortName <String>] [-PrintProcessor <String>] [-Priority <UInt32>] [-Published <Boolean>]
[-RenderingMode <RenderingModeEnum>] [-SeparatorPageFile <String>] [-Shared <Boolean>] [-ShareName <String>]
[-StartTime <UInt32>] [-DisableBranchOfficeLogging <Boolean>] [-BranchOfficeOfflineLogSizeMB <UInt32>]
[-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-PassThru] [-WhatIf] [-Confirm]
[<CommonParameters>]
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 Get-Printer, 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 privileges to use Set-Printer.
PS C:\> Set-Printer -Name "Microsoft XPS Document Writer" -KeepPrintedJobs $true
This command configures the "Microsoft XPS Document Writer" printer to keep printed jobs.
PS C:\>$printer = Get-Printer -Name "Microsoft XPS Document Writer"
PS C:\>$printer.KeepPrintedJobs = $true
PS C:\>Set-Printer -InputObject $printer
This set of commands retrieves a printer object in to a variable ($printer) using Get-Printer, and passes the contents of the variable to Set-Printer.
ps_cimcommon_asjob
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227967 or Get-CimSessionhttp://go.microsoft.com/fwlink/p/?LinkId=227966 cmdlet. The default is the current session on the local computer.
Type: CimSession[]
Parameter Sets: (All)
Aliases: Session
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the text to add to the Comment field for the specified printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the computer on which the printer is installed.
Type: String
Parameter Sets: Name
Aliases: CN
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Prompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the data type the printer uses to record print jobs.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Indicates whether branch office remote logging is disabled. You cannot specify this parameter for unshared queues.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the printer driver for the printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the object which contains the printer information to update.
Type: CimInstance[]
Parameter Sets: InputObject (cdxml)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Specifies whether the printer jobs in the queue are kept.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Specifies the location of the printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the printer to modify.
Type: String[]
Parameter Sets: Name
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the permissions for the printer as an SDDL string.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the port used or created for the printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name of the print processor used by the printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the relative queue priority.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies whether or not the printer is published in the network directory service.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the rendering mode for the printer. You can specify one of the following three rendering modes: SSR, CSR, or BOPD
Type: RenderingModeEnum
Parameter Sets: (All)
Aliases:
Accepted values: SSR, CSR, BranchOffice
Required: False
Position: Named
Default value: CSR
Accept pipeline input: False
Accept wildcard characters: False
Specifies the path to and name of the separator page to be used by the printer.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the name by which to share the printer on the network. To change the share state of a printer, specify the Shared parameter.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Changes the share state of the printer.
Type: Boolean
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the starting time of printer availability.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the ending time of printer availability.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet accepts one printer object.
This cmdlet returns a printer object.