SOLVED

unable to use inputobject in get-printjob

%3CLINGO-SUB%20id%3D%22lingo-sub-1431636%22%20slang%3D%22en-US%22%3Eunable%20to%20use%20inputobject%20in%20get-printjob%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1431636%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20a%20way%20to%20see%20if%20a%20printer%20object%20on%20a%20remote%20computer%20has%20a%20printjob%20stuck%20to%20it.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20found%20out%20out%20%22get-printjob%22%20command%20from%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fprintmanagement%2Fget-printjob%3Fview%3Dwin10-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fprintmanagement%2Fget-printjob%3Fview%3Dwin10-ps%3C%2FA%3E%3C%2FP%3E%3CP%3EGet-PrintJob%3CBR%20%2F%3E%5B-ComputerName%20%3CSTRING%3E%5D%3CBR%20%2F%3E%5B-ID%20%3CUINT32%3E%5D%3CBR%20%2F%3E%5B-PrinterName%5D%20%3CSTRING%3E%3CBR%20%2F%3E%5B-CimSession%20%3CCIMSESSION%3E%5D%3CBR%20%2F%3E%5B-ThrottleLimit%20%3CINT32%3E%5D%3CBR%20%2F%3E%5B-AsJob%5D%3CBR%20%2F%3E%5B%3CCOMMONPARAMETERS%3E%5D%3CBR%20%2F%3EPowerShellCopy%3C%2FCOMMONPARAMETERS%3E%3C%2FINT32%3E%3C%2FCIMSESSION%3E%3C%2FSTRING%3E%3C%2FUINT32%3E%3C%2FSTRING%3E%3C%2FP%3E%3CP%3EGet-PrintJob%3CBR%20%2F%3E%5B-ID%20%3CUINT32%3E%5D%3CBR%20%2F%3E%5B-PrinterObject%5D%20%3CCIMINSTANCE%3E%3CBR%20%2F%3E%5B-CimSession%20%3CCIMSESSION%3E%5D%3CBR%20%2F%3E%5B-ThrottleLimit%20%3CINT32%3E%5D%3CBR%20%2F%3E%5B-AsJob%5D%3CBR%20%2F%3E%5B%3CCOMMONPARAMETERS%3E%5D%3C%2FCOMMONPARAMETERS%3E%3C%2FINT32%3E%3C%2FCIMSESSION%3E%3C%2FCIMINSTANCE%3E%3C%2FUINT32%3E%3C%2FP%3E%3CP%3Eon%20the%20syntax%20section%20it%20doesn't%20show%20%22inputobject%22%20but%20in%20the%20example%20it%20does.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24Printer%20%3D%20Get-Printer%20-Name%20%22PrinterName%3A%22%3CBR%20%2F%3EGet-PrintJob%20-InputObject%20%24Printer%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhen%20I%20try%20to%20use%20inputobject%20in%20get-printjob%20it%20gives%20me%20below%20error%3C%2FP%3E%3CP%3EGet-PrintJob%20%3A%20A%20parameter%20cannot%20be%20found%20that%20matches%20parameter%20name%20'inputobject'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A14%3CBR%20%2F%3E%2B%20get-printjob%20-inputobject%20%24prn1%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidArgument%3A%20(%3A)%20%5BGet-PrintJob%5D%2C%20ParameterBindingException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20NamedParameterNotFound%2CGet-PrintJob%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1431636%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eget-printjob%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1434705%22%20slang%3D%22en-US%22%3ERe%3A%20unable%20to%20use%20inputobject%20in%20get-printjob%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1434705%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F398468%22%20target%3D%22_blank%22%3E%40Jamal1245%3C%2FA%3E%26nbsp%3BIt%20looks%20like%20the%20documentation%20is%20not%20up-to-date.%20Inputobject%20is%20not%20a%20valid%20parameter%20anymore.%20You%20need%20to%20replace%20it%20with%20-PrinterObject.%20See%20the%20snippet%20below%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24printer%20%3D%20Get-Printer%20%22Canon%20MP550%20series%20Printer%22%0AGet-PrintJob%20-PrinterObject%20%24printer%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EGood%20Luck!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EManfred%20de%20Laat%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1440260%22%20slang%3D%22en-US%22%3ERe%3A%20unable%20to%20use%20inputobject%20in%20get-printjob%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1440260%22%20slang%3D%22en-US%22%3Ethanks.%20I%20will%20try%20it.%3C%2FLINGO-BODY%3E
New 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 (New 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.