Home » PowerShell » PowerShell – Get Printer Properties with [Examples]

PowerShell – Get Printer Properties with [Examples]

Using PowerShell Get-PrinterProperty cmdlet, it gets one or more printer properties for a specified printer.

In this article, I will explain to get printer properties like Collate, Color, DuplexingMode, Driver version details, and many more printer properties using PowerShell.

PowerShell – Get Printer Properties

Using PowerShell Get-PrinterProperty to retrieve printer properties. You can use Get-Printer-Property cmdlet to get printer properties in the Windows PowerShell remoting session.

PowerShell Tip: Use administrator credentials to run Get-PrinterProperty cmdlet.

Cmdlet: Get-PrinterProperty

Description: Retrieve printer properties for the specified printer

Syntax:

Get-PrinterProperty
   [[-PropertyName] <String[]>]
   [-ComputerName <String>]
   [-PrinterName] <String>
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]

Parameters:

-AsJob – Use this parameter to run the command as a background job. Use this parameter to run the command in the background if it is taking a long time. It can be more useful while getting printer properties for remote machines in PowerShell.

CimSession – This parameter runs the GetPrinterProperty cmdlet in remote computer or remote session.

-ComputerName – Use this parameter to specify the computer name from which GetPrinterProperty cmdlet will get printer properties.

-PrinterName – Use this parameter to specify the printer name from which to retrieve printer properties.

-PropertyName – Use this parameter to specify printer property to get property. wildcard characters do not work with this cmdlet and parameter.

-ThrottleLimit – This parameter specifies the maximum number of concurrent operations that can be established to run the cmdlet.

Let’s understand using PowerShell Get-PrinterProperty cmdlet to get printer properties using different examples as given below.

Do you know: PowerShell – IIS get list of websites !

PowerShell Get Printer Properties for Specific Printer

To get printer properties for a specific printer, run the below command

PS C:\> Get-PrinterProperty -PrinterName "Printer_RICOH_A"

In the above example, it gets the printer properties for a specific printer specified by PrinterName parameter.

PowerShell Tip: Using ErrorAction variable to handle errors in PowerShell!

Get Printer Properties for Remote Machine

To get printer properties for the remote machines, using PowerShell Get-PrinterProperty cmdlet, we can display properties. Use below command

PS C:\> Get-PrinterProperty -ComputerName CORP-IN-18 -PrinterName "Printer_RICHOH_A"

ComputerName         PrinterName          PropertyName         Type       Value                         
------------         -----------          ------------         ----       -----                         
CORP-IN-18           Priter_RICHOH_A       FormTrayTable       String       

In the above example, PowerShell Get-PrinterProperty cmdlet has -ComputerName parameter. Using the Computer name and printer name specified by -PrinterName parameter, it retrieves printer properties.

Get Printer Properties for all installed Printers

To get printer properties for all installed printers on the computer ( local or remote machine), we can use PowerShell Get-Printer cmdlet to get list of printers, and using Get-PrinterProperty it will loop over each printer to get printer property as given in the below example.

PS C:\>$printers = Get-Printer * 
foreach ($printer in $printers)
{ 
    Get-PrinterProperty -PrinterName $printer.name 
}

In the above example, Get-Printer * gets all printers and stores it in $printers variable.

Using Foreach loop, it iterates over each printer and get printer properties by specified $printer.name

PowerShell Tip: How to add newline to string or variable?

PowerShell Get Printer Property using PropertyName

To get printer property, using PowerShell Get-PrinterProperty cmdlet, it has -PropertyName parameter. It retrieves property specified by PropertyName.

PS C:\> Get-PrinterProperty -ComputerName CORP-IN-18 -PrinterName "Printer_RICHO_A" -PropertyName FormTrayTable

ComputerName         PrinterName          PropertyName         Type       Value                         
------------         -----------          ------------         ----       -----                         
CORP-IN-18       Printer_RICHO_A      FormTrayTable        String                                   

In the above example, we specify FormTrayTable property in –PropertyName parameter.

PowerShell Tip: Using PowerShell script to restart Print Spooler Service!

Conclusion

I hope you find the above article on using PowerShell Get-PrinterProperty cmdlet to get one or more printer properties useful and educational.

To get all printers installed on the computer, use Get-Printer * and loop over each printer to get printer property. Note, you can not use wildcard characters with PowerShell Get-PrinterProperty.

You can find more topics about PowerShell Active Directory commands and PowerShell basics on ShellGeek home page.

Leave a Comment