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.
0
Comments
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.
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
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!