Trying to get logoff script to clear print queue - It will not run when a domain user logs off

Answered Trying to get logoff script to clear print queue - It will not run when a domain user logs off

  • 01 Mei 2012 17:21
     
     

    Here is the problem:

    I have 15 machines that are basically Kiosks that print off information from a webpage after a domain user logs in. For some reason the print queues have been jamming and the GPO is not clearing the print queue on logoff as it should. I do not have access to the GP server/settings and the individual that has set up this policy has been less than helpful.

    I have tried to create a local GP logoff script that will run to clear the print queue on logoff. It appears to run when the local administrator logs off but it will not run when a domain user logs off. Is there a way to have the script either run as local admin whenever anyone logs off(ideal solution) or so it will run as the domain user when they logoff.

    Here is the really really basic script I am trying to run:

    net stop spooler
    del c:\windows\system32\spool\printers\*.shd
    del C:\windows\system32\spool\printers\*.spl
    net start spooler

    Any help is greatly appriciated Thanks!!!

Semua Balasan

  • 02 Mei 2012 1:11
     
     

    From memory, computer based startup/shutdown scripts run as the local system, so have admin rights. User based logon/logoff scripts run as the user, which is why your script is not working (Requires admin rights to stop the spooler).

    Do you have to have it when the users logoff rather then reboot/shutdown?

  • 02 Mei 2012 7:44
    Moderator
     
     

    Hi ,

    If you want to it works for the domain users, you need to add the script to a Group Policy Object on a Domain Controller.

    This article may helpful for you: http://mctexpert.blogspot.com/2010/12/how-to-clear-print-queue-when-user-logs.html

    Please Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.



    Tracy Cai

    TechNet Community Support

  • 02 Mei 2012 14:27
     
     

    Having it clear when the system shuts down wont work unfortunatley, the devices are kiosks that have a stipped down version of windows 7. All the user has access to when they log in is IE. Once they close IE they are logged out.

    I don't have permissions to add/edit GPO's, and the individual that created the GPO to force the print queue to clear on log off doesn't really want to look into why it's not functioning properly on logoff. I was hoping there was a way around GPO's using a local group policy...

    I also really would prefer to not store the admin password in plain text form in the script...I have read about the tool that allows you to basically encrypt the admin password for scripts(I can't for the life of me remember what it was called though) but I don't really think that's the solution either.

    Right now I'm pretty much forced to watch the spooler on all the machines and clear them as they jam, wasting alot of my time

  • 02 Mei 2012 22:45
     
     Jawab

    It might be worth asking in the Scripting Guys forum on how to run a script that pulls a password out of an encrypted file.

    http://social.technet.microsoft.com/Forums/en-AU/ITCG/threads