+ Post New Thread
Results 1 to 11 of 11
Windows Thread, Automatically clear printer queue on log off? in Technical; I'm sure I remember seeing something about this in another thread, but I cannot find it anywhere, so decided to ...
  1. #1

    Join Date
    May 2006
    Posts
    1,319
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    26

    Automatically clear printer queue on log off?

    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!

  2. #2

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Automatically clear local printer queue on log off?

    Are these network printers or locally connected printets?

    If network why not just not allocate them to students?

    Ben

  3. #3

    Join Date
    May 2006
    Posts
    1,319
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    26

    Re: Automatically clear local printer queue on log off?

    Quote Originally Posted by plexer
    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.

  4. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Automatically clear local printer queue on log off?

    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

  5. #5

    Join Date
    May 2006
    Posts
    1,319
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    26

    Re: Automatically clear printer queue on log off?

    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.

  6. #6

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Automatically clear printer queue on log off?

    Try this code on a workstation:

    Code:
    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

  7. #7

    Ric_'s Avatar
    Join Date
    Jun 2005
    Location
    Boston, MA
    Posts
    7,601
    Thank Post
    110
    Thanked 771 Times in 599 Posts
    Rep Power
    183

    Re: Automatically clear printer queue on log off?

    My script in the scripts section also removes existing printers at logon. It does leave LPT and USB attached printers though.

  8. #8

    Join Date
    May 2006
    Posts
    1,319
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    26

    Re: Automatically clear printer queue on log off?

    Quote Originally Posted by plexer
    Try this code on a workstation:

    Code:
    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:


  9. #9

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Automatically clear printer queue on log off?

    You can change the one above to only remove networked ones by changing the commented sections as shown in the code.

    Ben

  10. #10

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,689
    Thank Post
    755
    Thanked 1,715 Times in 1,526 Posts
    Rep Power
    438

    Re: Automatically clear printer queue on log off?

    Try the attached vbs file just in case the code formatting has got screwed when you pasted it.

    Ben
    Attached Files Attached Files

  11. #11

    Join Date
    May 2006
    Posts
    1,319
    Thank Post
    101
    Thanked 25 Times in 18 Posts
    Rep Power
    26

    Re: Automatically clear printer queue on log off?

    Still the same error unfortunately .



SHARE:
+ Post New Thread

Similar Threads

  1. how to clear history
    By callumtuckey in forum Windows
    Replies: 7
    Last Post: 12th June 2007, 10:09 AM
  2. Printer Queue - stalled job killer
    By contink in forum Scripts
    Replies: 9
    Last Post: 16th April 2007, 08:57 PM
  3. Exchange mailserver queue is in the 1000s?
    By Jake in forum General Chat
    Replies: 15
    Last Post: 23rd January 2007, 07:57 PM
  4. GPO to clear Internet History daily?
    By woody in forum Windows
    Replies: 8
    Last Post: 12th September 2006, 01:56 PM
  5. Printer queue control for teachers
    By NetworkGeezer in forum How do you do....it?
    Replies: 11
    Last Post: 17th May 2006, 05:30 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •