ICT_GUY Posted March 30, 2011 Posted March 30, 2011 I have tried lots of scripts to remove old printers showing up in the installed printers, nothing seems to work well and over time their seems to accumulate a variety of defunct printers to confuse the teachers when printing. Has anyone found an utterly fool proof of permanently removing these old ghost printers from showing up? Please?
sfoord Posted March 30, 2011 Posted March 30, 2011 Here is the vb script I used when I need to remove old printers from the clients when I had this problem, You have to add the current printers afterwards in the same script On Error resume next ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' DELETE ALL Network Printers ON PC ' ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 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 ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Create Network Printers ' ' ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim oNetwork, WshNetwork Set oNetwork = CreateObject("Wscript.Network") oNetwork.AddWindowsPrinterConnection "\\server\SUITE-MONO" oNetwork.AddWindowsPrinterConnection "\\server\SUITE-COLOUR" oNetwork.SetDefaultPrinter "\\server\SUITE-COLOUR" Set oNetwork = nothing 1
sfoord Posted March 30, 2011 Posted March 30, 2011 Just set it to run when the teacher or students logon on in GPO. This will delete all network printers on the pc, but not local ones Hope this helps 1
Michael Posted March 30, 2011 Posted March 30, 2011 2003 Resource Kit includes a Spooler Cleaner. You can also remotely clean a workstation spooler and then reboot it. 1
ICT_GUY Posted March 30, 2011 Author Posted March 30, 2011 2003 Resource Kit includes a Spooler Cleaner. You can also remotely clean a workstation spooler and then reboot it. Have you a link to how to use Cleanspl.exe via AD?
Michael Posted March 30, 2011 Posted March 30, 2011 I don't think you can to be honest. Just run cleanspl.exe from C:\Program Files\Windows Resource Kits\Tools on one of your servers and either manually search or enter the computer name. In turn type the computer name. You shouldn't need to type anything else. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now