Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficePrintJob

Module
PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Workflows.PdfPrintJobStatus

Reports the state of a print job submitted with Send-OfficePrinter, optionally waiting until it finishes. Requires PowerShell 7.4 or newer.

Syntax

Get-OfficePrintJob
[-JobId] <String>
[-PrinterName] <String>
[-TimeoutSeconds <Int32>]
[-Wait]
[<CommonParameters>]
#
Parameter set: Default

Description

States are the same for every transport: Pending, Held, Processing, Stopped, Canceled, Aborted, Completed and Removed. Removed means the queue no longer reports the job: it finished and was purged, was deleted, or never existed.

Examples

Wait up to two minutes for a submitted job.

$receipt = Send-OfficePrinter -Path .\Report.pdf -PrinterName 'Office printer'
$receipt | Get-OfficePrintJob -Wait -TimeoutSeconds 120

Check a job by printer and identifier.

Get-OfficePrintJob -PrinterName 'Office printer' -JobId 'Office_printer-42'

Parameters

-JobId String requiredposition: 1pipeline: True (ByPropertyName)
The job identifier from the receipt.
-PrinterName String requiredposition: 0pipeline: True (ByPropertyName)
The printer queue name or IPP URI from the receipt.
-TimeoutSeconds Int32 optional
Longest wait in seconds when Wait is set.
-Wait SwitchParameter optional
Wait until the job is canceled, aborted, completed or removed.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.