Remove-PrintJob

Remove-PrintJob

Removes a print job on the specified printer.

Sintaxis

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

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

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

Descripción detallada

The Remove-PrintJob cmdlet removes a print job on the specified printer.

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

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

You do not need administrator privileges to use Remove-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 remove the print job.

Alias

CN,computer

¿Requerido?

false

¿Posición?

named

Valor predeterminado

ninguno

¿Aceptar canalización?

True (ByPropertyName)

¿Aceptar caracteres comodín?

false

-ID<UInt32>

Specifies the ID of a print job to remove on the specified printer.

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 remove 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 a printer name on which to remove 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 object which contains the printer on which to remove 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.

Ejemplos

Example 1: Remove a selected print job

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

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

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

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

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

Example 3: Remove a print job using a print job object

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

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

Temas relacionados

Get-PrintJob

Restart-PrintJob

Suspend-PrintJob

Resume-PrintJob