So you want to know how to create a script to delete a TCP/IP printer from a computer? You are in luck. There are several ways to do this, but the easiest way to accomplish this is by using the ‘WMIC’ command. Once you have the command created, you can save it as a batch file and link it to a GPO.
e.g. wmic printer where “PortName LIKE ‘IP_%%’” delete
This will delete all TCP/IP printers.
e.g. wmic printer where “PortName LIKE ‘IP_192.168.1.25′” delete
This will delete TCP/IP printer 192.168.1.25
Related Tech posts:
- Deploying printer connection ‘\\server Name\Printers’ to per machine GPO ‘GPO name’ failed. The specified directory service attribute or value does not exist.
- How to cancel or delete a print job that is stuck in the print queue?
- How to Disable TCP Auto-Tuning?
- Assign Printers Based on Group Membership
- How to add a printer to your printer list in Mac OS X?