1.

Solve : calculate number of prints withina specified time?

Answer»

I want to calculatethenumber of prints TAKEN from a particular computer on LAN,printer is connected to the main computer, I just want to keep a check on users printing printsYou want to count the number of prints on the LAN, but the printer is connected to the local computer? I'm not sure I understand. What OS are you running, and what printer and print driver (type and version) are you using?I have 10computers in a simple LAN CONNECTION, printer HP lazerjet 1010 is shared to all the computers, users keep on printing documents and then deny that its thier print or not, I just want to get a fool proof method to check who is printing what and how many ?...i hope this explains you the querry sir.....Oh i forgot to mention , OS is win2k professional SP4I'm not sure that there is any record of print jobs once they've been purged from the queue. This little script will monitor jobs submitted for print in real-time.

Code: [Select]strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colPrintJobs = objWMIService. _
ExecNotificationQuery("Select * From __InstanceCreationEvent " _
& "Within 3 Where TargetInstance ISA 'Win32_PrintJob'")

Do While True
Set objPrintJob = colPrintJobs.NextEvent
WSCRIPT.Echo objPrintJob.TargetInstance.HostPrintQueue, Now, objPrintJob.TargetInstance.Caption
Loop

As written the script will log print jobs to the console, but with a little imagination, you could log the messages to a file. Save the script with a vbs extension and run from the COMMAND line as either wscript scriptname.vbs OR cscript scriptname.vbs. If run with WSCRIPT use the task manager to kill the job. If run with CSCRIPT, it will run in a window and you can use CTL-C to kill the job.

Hope this helps. 8-)

Afterthought: Configure separator pages for the printer. They may give you the info you need to trace the job.



Discussion

No Comment Found