Avoid Generic Error with WMIC

I'm trying to delete network printers using the line "wmic printer where local=false delete" 

This works fine if run from the PC directly, but returns a generic error when sent through PDQ Deploy. I'm sure it's something simple, I just can't seem to come up with a solution.



Date Votes
  • Is your PDQ Deploy service account an admin on the target PC?

  • Yes, PDQ Deploy is an admin on the target PC.  I've tried other PCs as well, still receiving the same error.

    1. What is the full error message?
    2. Are you using the PDQ Deploy service account when you run the command directly?
  • Running it again today did not yield any errors, but instead returned successful with no instances found.  I tested on 2 different PCs with the same result, both having 3 network printers installed.

  • Are you running this as a Command step (as a file) or an Install step? If you're running it as a Command step, can you package the

    wmic printer where local=false delete

    in a .bat file and run it locally and successfully? If so, try deploying the .bat file.

    There is also another issue, and one that I think is the cause of the problem rather than the deployment method. Network printers are generally installed in a user-context, whereas we deploy packages and commands in a machine-context. You might have better results changing the Options (tab) of the step to "Run As" Logged on User, which will remove the network printers for the logged on user.

    If the printers were installed for all users, the delete command is likely going to be different.

  • You were spot on with your thought.  Both the command and the .bat file ran perfectly fine if launched from the PC itself, running as Logged On User did the trick for PDQ Deploy.  Thanks!


Please sign in to leave a comment.

Didn't find what you were looking for?

New post