How to remove a printer connection without the user’s intervention

print-serverwindows 7windows-xp

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!

Best Answer

Group Policy Printer Preferences contains a "Delete" option. If you're deploying the new printers with a GPP GPO, you can add the Delete items to the end of it, or create a whole new Delete Printers GPO.

I just did a transition like this for about 75 printers and it went very smoothly. We have one Deploy Printers GPO linked at the domain level with all of the printers in it, and mappings are controlled via group membership using Item Level Targeting. We also have a Deleted Printers GPO at the domain level that has all of the old printers on the old print server on it. I didn't bother filtering this, because there's really no need. If it's old and it's mapped, it's got to go!

The good thing about GPP items is that they are run at policy refresh intervals, meaning that no logon/logoff/reboot is required. Just configure the policy, link it, and sit back. No messing with scripts or WMI or any of that.