Recently our print server went down so I had to install printers manually through creating a local TCP/IP port and the address of the printer. I now need to remove the printers with IP Addresses before re-adding the new printers on the print server. However, it MUST be IP address printers and NOT local printers as they are specific to that machine and cannot be removed! It needs to work on both windows XP and 7. Thank you.
Script i've found so far:
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Network = TRUE")
For Each objPrinter in colInstalledPrinters
objPrinter.Delete_
Next