Always love when you get surprised by printer issues? Here is a one liner that in its current state works great, but can be expanded on to be even more powerful, or gives you an idea to go more in depth.
invoke-command -computername ServerName -credential YourUser -scriptblock {get-printer | select-object name, printerstatus, portname}
This code will connect to your print server or user computer and check all printers installed and their status. It’s not limited to one computer for situations where you have multiple printer servers or need to check on multiple user computers. It will even show when toner and paper jams. Wouldn’t it be nice to see if the user is even connected to the printer they are trying to print to or if the printer is saying there is a paper jam?
To go a step farther, you could set this up as a scheduled task or have it monitor, and send a toast notification, create a ticket depending on the error, or send a chat message to your teams/discord/slack channel. To go even more granular, you could connect to the printer’s API and check toner levels, and have it order that toner when it hits the pre-determined threshold.
Hoping this little one liner helps out, and gives you some more ideas on how you can expand on it, to make your lives easier. If you have a related script, please post it in the comments for more ideas.
PowerShell Help:
Get-Printer
Leave a Reply