I'm trying to compile a list of all printers connected via USB within my company, ideally along with the computers they're connected to. I've been using the 'Printers and Scanners' add device option, but I'm not sure how to extract this information. I've dabbled in some PowerShell scripts that I've found online, but as I'm just three days into learning PowerShell, I'm having a tough time getting it to work. Any advice would be greatly appreciated!
5 Answers
How are your endpoints managed? Do you use any tools like MECM or Intune? If you're running your script locally, use WMI with commands like `Get-WmiObject -Class Win32_Printer`. If you're going for remote execution, try `Get-CimInstance` via WinRM. Just make sure you have the right permissions to execute these commands!
What specific commands have you been trying? It'd help to know where you've run them from. Are you also aware of the operating systems on your machines and who has admin rights? These details can influence how you access the printers.
You might want to start by getting a list of all the computers in your network. Then, you can ask each computer for its installed printers using PowerShell commands. A useful resource for this is the [Server Fault link](https://serverfault.com/questions/419866/list-all-printers-using-powershell). Also, just a quick reminder, don’t forget to leverage your creative side! 😄
You could also set up a PowerShell script that checks printers across a list of computers from a CSV file. The script should log the results, which you can then sort in Excel. Just keep in mind it’s untested, so you might need to tweak it. But hey, it gives you a solid starting point!
For just listing USB-connected printers, you can try the command: `Get-Printer | Where-Object portname -like usb*`. You’ll need to run it on each computer, though—consider using remoting options or an RMM tool if you have that set up.

We're a small team with everything running in-house on VMs, and we manage everything with Active Directory and Office 365, so it’s pretty streamlined.