Home » PowerShell » How to Get Printer Serial Number Using PowerShell

How to Get Printer Serial Number Using PowerShell

To get the printer serial number using the PowerShell, use the `Get-WmiObject` cmdlet. The Get-WmiObject command uses the Win32_Printer class that represents a printer object in WMI to find the serial number of printers using the SerialNumber property.

Here is the PowerShell command to find the printer serial number.

Get-WmiObject -Class Win32_Printer | Select-Object SerialNumber

In the above PowerShell script, the Get-WmiObject command is used to get objects from the Windows Management Instrumentation (WMI) repository. This command retrieves the printer objects in WMI using the class Win_32 Printer.

It returns a list of all printers installed on the computer and pipes them to the Select-Object command to get the serial number of printers using the SerialNumber property.

The output of the above PowerShell script that returns the serial number of the printers is given below.

PS D:\PS> Get-WmiObject -Class Win32_Printer | Select-Object SerialNumber                                                                         
SerialNumber
------------
BC44138118

If there is no printer installed on the computer, the Get-WmiObject command will return an empty array.

You can also use the Get-WmiObject alias command gwmi to write a query in a short format to get the printer serial number in the Windows 10 system.

gwmi win32_printer | Select-Object SerialNumber

Cool Tip: How to get the default printer installed on the computer using PowerShell!

Conclusion

I hope the above article on how to get the printer serial number on the Windows operating system using the PowerShell Get-WmiObject command is helpful to you.

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