We have a program that routes all of it’s printing through a ‘helper’ app. The helper app formats the data into print ready output and sends it to the appropriate print queue on the server. Through some flaw in either the app or the print driver, periodically a standard windows “Print” dialog will come up, allowing for choice of printer or changing settings for the job. When this happens, all subsequent print jobs are held up until someone logs onto the server and clicks “Cancel” on the dialog. (If you click print, it causes future jobs to print using incorrect settings.)
For various reasons, the helper app runs under a local account on the server with administrator rights. This means when staff notice a problem printing, they call the helpdesk, who notifies a tech or server admin, who logs onto the existing session with the local account, cancels the print dialog, and then the session. (We just hired a new helpdesk person a month or so ago. If I can’t find another workaround for this issue, they may eventually get the credentials to log onto this server so they can cancel the print dialog without involving anyone else, but not yet.)
Would it be possible for a powershell script either running in the background, or run as a scheduled task every 1-2 minutes, to look for an open print dialog in this local user’s session and cancel it automatically? How could I go about detecting the open window, and sending a cancel to it?
- I realize that I may well be trying to drive a screw in with a hammer here. . . if there’s a better tool to use for this than powershell, I’m open to suggestions.