Restart-PrintJob

Restart-PrintJob

Restarts a print job on the specified printer.

Sintaxis

Parameter Set: jobObject
Restart-PrintJob [-InputObject] <CimInstance> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: printerName
Restart-PrintJob [-PrinterName] <String> [-ID] <UInt32> [-AsJob] [-CimSession <CimSession[]> ] [-ComputerName <String> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: printObject
Restart-PrintJob [-PrinterObject] <CimInstance> [-ID] <UInt32> [-AsJob] [-CimSession <CimSession[]> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descripción detallada

The Restart-PrintJob cmdlet restarts a print job on the specified printer.

You can specify the print job to restart by specifying the PrinterName and ID parameters, by specifying printer object and job ID parameter, or by specifying the job object as an input.

You cannot use wildcard characters with Restart-PrintJob. You can use Restart-PrintJob in a Windows PowerShell remoting session.

You do not need administrator privileges to use Restart-PrintJob.

Parámetros

-AsJob

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

-ComputerName<String>

Specifies the name of the computer on which to restart the print job.

Alias

CN,computer

¿Requerido?

false

¿Posición?

named

Valor predeterminado

local machine name

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ID<UInt32>

Specifies the ID of the print job to restart on the specified printer. You can use wildcard characters.

Alias

ninguno

¿Requerido?

true

¿Posición?

2

Valor predeterminado

ninguno

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-InputObject<CimInstance>

Specifies the object which contains the print job to restart on the specified printer.

Alias

ninguno

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue)

¿Aceptar caracteres comodín?

false

-PrinterName<String>

Specifies the printer name on which to restart the print job.

Alias

PN

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue, ByPropertyName)

¿Aceptar caracteres comodín?

false

-PrinterObject<CimInstance>

Specifies the printer object which contains the printer on which to restart the print job.

Alias

Printer

¿Requerido?

true

¿Posición?

1

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByValue, ByPropertyName)

¿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

-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_PrintJob

    This cmdlet accepts one print job object.

Salidas

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

  • This cmdlet produces no output.

Ejemplos

Example 1: Restart a selected print job

This command restarts the print job with an ID of 1 on the printer named PrinterName.

PS C:\> Restart-PrintJob -PrinterName "PrinterName" -ID 1

Example 2: Restart a print job by using printer object and the print job ID

This set of commands retrieves the printer object in to a variable ($printer) using Get-Printer, and then passes the content of the variable to Restart-PrintJob to restart the print job with the ID of 1 on the printer contained in the printer object.

PS C:\> $printer = Get-Printer -PrinterName "PrinterName"
PS C:\> Restart-PrintJob -PrinterObject $printer -ID 1

Example 3: Restart print job using job object

This set of commands retrieves the print job with an ID of 1 in to a variable ($printJob) using Get-PrintJob, and then passes the contents of the variable to Restart-PrintJob to restart the print job on a printer by using a print job object.

PS C:\> $printJob = Get-PrintJob -PrinterName "PrinterName:" -ID 1
PS C:\> Restart-PrintJob -InputObject $printJob

Temas relacionados

Get-PrintJob

Remove-PrintJob

Suspend-PrintJob

Resume-PrintJob