Jun 01 2020 10:34 AM
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
Jun 02 2020 02:49 PM
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