SOLVED

unable to use inputobject in get-printjob

Copper Contributor

I need a way to see if a printer object on a remote computer has a printjob stuck to it. 

I found out out "get-printjob" command from https://docs.microsoft.com/en-us/powershell/module/printmanagement/get-printjob?view=win10-ps

Get-PrintJob
[-ComputerName <String>]
[-ID <UInt32>]
[-PrinterName] <String>
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]
PowerShellCopy

Get-PrintJob
[-ID <UInt32>]
[-PrinterObject] <CimInstance>
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]

on the syntax section it doesn't show "inputobject" but in the example it does. 

 

$Printer = Get-Printer -Name "PrinterName:"
Get-PrintJob -InputObject $Printer

 

when I try to use inputobject in get-printjob it gives me below error

Get-PrintJob : A parameter cannot be found that matches parameter name 'inputobject'.
At line:1 char:14
+ get-printjob -inputobject $prn1
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-PrintJob], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Get-PrintJob

 

 

 

2 Replies
best response confirmed by Jamal1245 (Copper Contributor)
Solution

@Jamal1245 It looks like the documentation is not up-to-date. Inputobject is not a valid parameter anymore. You need to replace it with -PrinterObject. See the snippet below:

$printer = Get-Printer "Canon MP550 series Printer"
Get-PrintJob -PrinterObject $printer

Good Luck!

 

Manfred de Laat

thanks. I will try it.
1 best response

Accepted Solutions
best response confirmed by Jamal1245 (Copper Contributor)
Solution

@Jamal1245 It looks like the documentation is not up-to-date. Inputobject is not a valid parameter anymore. You need to replace it with -PrinterObject. See the snippet below:

$printer = Get-Printer "Canon MP550 series Printer"
Get-PrintJob -PrinterObject $printer

Good Luck!

 

Manfred de Laat

View solution in original post