How do I remove a printer connection without the user's intervention?

Posted by 1.618 on Server Fault See other posts from Server Fault or by 1.618
Published on 2012-12-19T22:57:03Z Indexed on 2012/12/19 23:04 UTC
Read the original article Hit count: 126

Here's the situation: We're replacing 11 printers with newer models, and we'll be installing them on our print server and sharing them out. The plan is to share the new printers under different names than the ones they're replacing, and un-share the old ones.

So I need to come up with a way to remove the client connections to old printers automatically. Clients are mostly Windows 7 with a few XP.

My first idea was to call prnmngr.vbs from the login script to remove each old printer explicitly by name. The problem is that some users don't log out when they're done for the day, so I can't count on their login script running before they next need to print. I could remotely run prnmngr.vbs using SCCM, but if it's not 'impersonating' the user, I don't think it will remove their printers. Any ideas? Could I lookup how to access WMI using c# code and write a "trojan" to remove specific printers without requiring the user to do anything? (I'm only half joking).

I'm open to any suggestion! Thanks!

© Server Fault or respective owner

Related posts about windows-7

Related posts about windows-xp