Set-Printer

Set-Printer

Updates the configuration of an existing printer.

Sintaxis

Parameter Set: Name
Set-Printer [-Name] <String[]> [-AsJob] [-BranchOfficeOfflineLogSizeMB <UInt32> ] [-CimSession <CimSession[]> ] [-Comment <String> ] [-ComputerName <String> ] [-Datatype <String> ] [-DisableBranchOfficeLogging <Boolean> ] [-DriverName <String> ] [-KeepPrintedJobs <Boolean> ] [-Location <String> ] [-PassThru] [-PermissionSDDL <String> ] [-PortName <String> ] [-PrintProcessor <String> ] [-Priority <UInt32> ] [-Published <Boolean> ] [-RenderingMode <RenderingModeEnum> ] [-SeparatorPageFile <String> ] [-Shared <Boolean> ] [-ShareName <String> ] [-StartTime <UInt32> ] [-ThrottleLimit <Int32> ] [-UntilTime <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: InputObject (cdxml)
Set-Printer -InputObject <CimInstance[]> [-AsJob] [-BranchOfficeOfflineLogSizeMB <UInt32> ] [-CimSession <CimSession[]> ] [-Comment <String> ] [-Datatype <String> ] [-DisableBranchOfficeLogging <Boolean> ] [-DriverName <String> ] [-KeepPrintedJobs <Boolean> ] [-Location <String> ] [-PassThru] [-PermissionSDDL <String> ] [-PortName <String> ] [-PrintProcessor <String> ] [-Priority <UInt32> ] [-Published <Boolean> ] [-RenderingMode <RenderingModeEnum> ] [-SeparatorPageFile <String> ] [-Shared <Boolean> ] [-ShareName <String> ] [-StartTime <UInt32> ] [-ThrottleLimit <Int32> ] [-UntilTime <UInt32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

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.

Parámetros

-AsJob

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-BranchOfficeOfflineLogSizeMB<UInt32>

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.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-CimSession<CimSession[]>

Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.

Alias

Session

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Comment<String>

Specifies the text to add to the Comment field for the specified printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ComputerName<String>

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

Alias

CN

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Datatype<String>

Specifies the data type the printer uses to record print jobs.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-DisableBranchOfficeLogging<Boolean>

Indicates whether branch office remote logging is disabled. You cannot specify this parameter for unshared queues.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-DriverName<String>

Specifies the name of the printer driver for the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-InputObject<CimInstance[]>

Specifies the object which contains the printer information to update.

Alias

ninguno

¿Requerido?

true

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue)

¿Aceptar caracteres comodín?

false

-KeepPrintedJobs<Boolean>

Specifies whether the printer jobs in the queue are kept.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

False

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Location<String>

Specifies the location of the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Name<String[]>

Specifies the name of the printer to modify.

Alias

ninguno

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-PassThru

Devuelve un objeto que representa el elemento con el que está trabajando. De forma predeterminada, este cmdlet no genera ningún resultado.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PermissionSDDL<String>

Specifies the permissions for the printer as an SDDL string.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PortName<String>

Specifies the name of the port used or created for the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-PrintProcessor<String>

Specifies the name of the print processor used by the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Priority<UInt32>

Specifies the relative queue priority.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Published<Boolean>

Specifies whether or not the printer is published in the network directory service.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-RenderingMode<RenderingModeEnum>

Specifies the rendering mode for the printer. You can specify one of the following three rendering modes: SSR, CSR, or BOPD

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

CSR

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-SeparatorPageFile<String>

Specifies the path to and name of the separator page to be used by the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ShareName<String>

Specifies the name by which to share the printer on the network. To change the share state of a printer, specify the Shared parameter.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Shared<Boolean>

Changes the share state of the printer.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-StartTime<UInt32>

Specifies the starting time of printer availability.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-ThrottleLimit<Int32>

Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-UntilTime<UInt32>

Specifies the ending time of printer availability.

Alias

ninguno

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Confirm

Solicita confirmación antes de ejecutar el cmdlet.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-WhatIf

Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.

¿Requerido?

false

¿Posición?

named

Valor predeterminado

falso

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_Printer

    This cmdlet accepts one printer object.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_Printer

    This cmdlet returns a printer object.

Ejemplos

Example 1: Set printer to keep printed jobs

This command configures the "Microsoft XPS Document Writer" printer to keep printed jobs.

PS C:\> Set-Printer –Name "Microsoft XPS Document Writer" -KeepPrintedJobs $true

Example 2: Set printer to keep printed jobs by using a printer object

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 C:\> $printer = Get-Printer –Name "Microsoft XPS Document Writer"
PS C:\> $printer.KeepPrintedJobs = $true
PS C:\> Set-Printer –InputObject $printer

Temas relacionados

Add-Printer

Get-Printer

Remove-Printer

Rename-Printer