_Bat_ Posted December 18, 2006 Posted December 18, 2006 I'm sure I remember seeing something about this in another thread, but I cannot find it anywhere, so decided to make my own. I'll start by giving out current scenario: We have two laser printers, one colour and one B&W. Colour is obviously very expensive and the kids have an uncanny habit of printing out 10 pages of the same full A4 colour picture which didn't need to be printed in the first place. We were asked to stop kids being able to print to colour laser, meaning only staff could. Simple enough job - remove students permissions on the printer. This leaves one issue though... when the students print something to the colour printer, it fails, but the local machine keeps the document stored to that printer with the status 'failed'. After that, all documents printed to the colour printer from that machine fail - even after the student has logged off and a staff member has logged on. The print queue doesn't ever clear after reboot. Obviously clearing the print queue manually on that machine will solve the issue, but past experience has told me that getting people to do that successfully is not going to happen. Someone mentioned previously on here about a staff member who admitted she "switched off" when she heard him start to talk about computers, leading to problems later that day. My N/M doesn't like any third party software installed on the server unless absolutely necessary. I guess this is for money saving purposes as well as fear of installing potentially dodgy software on the server. He has recently re-added the students user group to the printer because of the above problem, but today after several unless pages came out of the colour printer I was asked to remove it again. In this case, is there any way to get windows client machines to clear the print queue automatically when domain user logs off? If not, I will design an annotated PDF document to send around to all staff by e-mail explaining how to do it, but ideally I would obviously rather I could do something myself to prevent them having to. Cheers!
plexer Posted December 19, 2006 Posted December 19, 2006 Are these network printers or locally connected printets? If network why not just not allocate them to students? Ben
_Bat_ Posted December 19, 2006 Author Posted December 19, 2006 Are these network printers or locally connected printets? If network why not just not allocate them to students? Ben Yes, they are network printers. I should have made that more clear, sorry. When I said 'local printer queue", I meant the queue being local, not the printer. Do you mean so the students cannot see the printer at all? How do you do this? I assumed that a printer was installed on a per machine basis as opposed to a per user basis. The only thing I can think of is to remove student permissions on the printer, but this is what is causing the problems stated in my first post.
plexer Posted December 19, 2006 Posted December 19, 2006 We use a vbs script very similar to one that is available from here that allocates printers on user login based on the machine name. It also removes all pre existing printer except local ones so if they have been added locally then you would need to remove them first and then have them reconnected by the vbs script. Without knowing the mechanism that has been used to allocate your printers it is difficult to answer. Ben
_Bat_ Posted December 19, 2006 Author Posted December 19, 2006 I THINK both printers were added manually at each machine . I believe the ones in the ICT Suite were imaged with the printers added and I went around each classroom machine adding them when I first started here (from what I remember). This is not a good answer is it? haha.
plexer Posted December 19, 2006 Posted December 19, 2006 Try this code on a workstation: Set WSHNetwork = CreateObject("WScript.Network") 'Remove ALL old printers 'Enumerate all printers first, after that you can select the printers you want by performing some string checks Set WSHPrinters = WSHNetwork.EnumPrinterConnections For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2 'To remove only networked printers use this If Statement ' If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then ' WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True ' End If 'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True Next 'end delete existing printers Copy and paste in to notepad and save as a vbs run it on a workstation and see if it removes the existing printers. Ben
Ric_ Posted December 19, 2006 Posted December 19, 2006 My script in the scripts section also removes existing printers at logon. It does leave LPT and USB attached printers though.
_Bat_ Posted December 19, 2006 Author Posted December 19, 2006 Try this code on a workstation: Set WSHNetwork = CreateObject("WScript.Network") 'Remove ALL old printers 'Enumerate all printers first, after that you can select the printers you want by performing some string checks Set WSHPrinters = WSHNetwork.EnumPrinterConnections For LOOP_COUNTER = 0 To WSHPrinters.Count - 1 Step 2 'To remove only networked printers use this If Statement ' If Left(WSHPrinters.Item(LOOP_COUNTER +1),2) = "\\" Then ' WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True ' End If 'To remove all printers incuding LOCAL printers use this statement and comment out the If Statement above WSHNetwork.RemovePrinterConnection WSHPrinters.Item(LOOP_COUNTER +1),True,True Next 'end delete existing printers Copy and paste in to notepad and save as a vbs run it on a workstation and see if it removes the existing printers. Ben When I run that the following appears: http://img350.imageshack.us/img350/5991/screenshotav3.jpg
plexer Posted December 19, 2006 Posted December 19, 2006 You can change the one above to only remove networked ones by changing the commented sections as shown in the code. Ben
plexer Posted December 19, 2006 Posted December 19, 2006 Try the attached vbs file just in case the code formatting has got screwed when you pasted it. Bendelete-printers.vbs
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