Page 1 of 1 1
Topic Options
#45966 - 2003-09-24 03:02 AM Capture Network Printouts
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
Ive been asked if there is a script or utility which will do the following:

Capture a printout from a win2k workstation and redirect it to a specific network printer based on the number of pages...

example: User prints to a network printer but since the number of pages is 25 pages or greater it gets automatically redirected to a another network printer...

Any suggestions or leads would be greatly appreciated...

thanks

John

Top
#45967 - 2003-09-24 03:43 AM Re: Capture Network Printouts
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
hmmm... odd request, but hey maybe someone has the answer. Please answer these questions though to help.

Since the script would need to count the pages first you would need to know what application.

Please list:
1. Application used to print doucments
2. Version of KiXtart
3. NT/AD Server
4. Are ALL Workstations Win2k

It might be possible to somehow intercept the print que but I'm not sure but there are some guys around here that mess a lot with printing tasks.

Top
#45968 - 2003-09-24 03:53 AM Re: Capture Network Printouts
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Excuse the VBS, but I'm too lazy to translate to KiX. [Frown]
Just wanted to show that WMI should expose the printjob properties. No Idea how you would intercept and redirect it though.



On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PrintJob",,48)
For Each objItem in colItems
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "DataType: " & objItem.DataType
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Document: " & objItem.Document
    Wscript.Echo "DriverName: " & objItem.DriverName
    Wscript.Echo "ElapsedTime: " & objItem.ElapsedTime
    Wscript.Echo "HostPrintQueue: " & objItem.HostPrintQueue
    Wscript.Echo "InstallDate: " & objItem.InstallDate
    Wscript.Echo "JobId: " & objItem.JobId
    Wscript.Echo "JobStatus: " & objItem.JobStatus
    Wscript.Echo "Name: " & objItem.Name
    Wscript.Echo "Notify: " & objItem.Notify
    Wscript.Echo "Owner: " & objItem.Owner
    Wscript.Echo "PagesPrinted: " & objItem.PagesPrinted
    Wscript.Echo "Parameters: " & objItem.Parameters
    Wscript.Echo "PrintProcessor: " & objItem.PrintProcessor
    Wscript.Echo "Priority: " & objItem.Priority
    Wscript.Echo "Size: " & objItem.Size
    Wscript.Echo "StartTime: " & objItem.StartTime
    Wscript.Echo "Status: " & objItem.Status
    Wscript.Echo "StatusMask: " & objItem.StatusMask
    Wscript.Echo "TimeSubmitted: " & objItem.TimeSubmitted
    Wscript.Echo "TotalPages: " & objItem.TotalPages
    Wscript.Echo "UntilTime: " & objItem.UntilTime
Next

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#45969 - 2003-09-24 03:55 AM Re: Capture Network Printouts
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
Thank you for your quick response...

All workstations are win2k and printing to win2k print server in a Domain enviroment..Most or all of the applications would be office 2000, 90 percent of the prints would be coming from Word..

This is a bit of a odd request but i can see many advantages to this, if its possible...

Thank you in advance...

Cheers

John

Top
#45970 - 2003-09-24 04:04 AM Re: Capture Network Printouts
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Rather than hijaak the printjobs, I would just tattle on the users and spam them with SendMessage() to use the other printer.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#45971 - 2003-09-24 04:14 AM Re: Capture Network Printouts
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
I solution has to be seamless with no user intervention...

The VB script is perfect, now the question is how do we intercept the print job once the user hits that print button...

Cheers

John

Top
#45972 - 2003-09-24 04:18 AM Re: Capture Network Printouts
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I can't see this being well received. If the printjob gets redirected with no user interaction, the users will not know their job was hijaacked and will probably reprint plus, they would never learn to send big jobs to a different printer.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#45973 - 2003-09-24 04:33 AM Re: Capture Network Printouts
John Offline
Fresh Scripter

Registered: 2001-09-27
Posts: 38
Loc: Canada
I understand your train of thought and you do bring up a good point but the goal is to automate this procedure and possibly include print load balancing..

John

Top
#45974 - 2003-09-24 04:36 AM Re: Capture Network Printouts
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I think the OS supports print load balancing. Obviously the printers need to be identical and side-by-side so users can find their jobs.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#45975 - 2003-09-24 07:30 AM Re: Capture Network Printouts
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Here you go.. Converted code (untested).



$strComputer = "."
$objWMIService = GetObject("winmgmts:\\" + $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_PrintJob",,48)
For Each $objItem in $colItems
    ?"Caption: " + $objItem.Caption
    ?"DataType: " + $objItem.DataType
    ?"Description: " + $objItem.Description
    ?"Document: " + $objItem.Document
    ?"DriverName: " + $objItem.DriverName
    ?"ElapsedTime: " + $objItem.ElapsedTime
    ?"HostPrintQueue: " + $objItem.HostPrintQueue
    ?"InstallDate: " + $objItem.InstallDate
    ?"JobId: " + $objItem.JobId
    ?"JobStatus: " + $objItem.JobStatus
    ?"Name: " + $objItem.Name
    ?"Notify: " + $objItem.Notify
    ?"Owner: " + $objItem.Owner
    ?"PagesPrinted: " + $objItem.PagesPrinted
    ?"Parameters: " + $objItem.Parameters
    ?"PrintProcessor: " + $objItem.PrintProcessor
    ?"Priority: " + $objItem.Priority
    ?"Size: " + $objItem.Size
    ?"StartTime: " + $objItem.StartTime
    ?"Status: " + $objItem.Status
    ?"StatusMask: " + $objItem.StatusMask
    ?"TimeSubmitted: " + $objItem.TimeSubmitted
    ?"TotalPages: " + $objItem.TotalPages
    ?"UntilTime: " + $objItem.UntilTime
Next



HTH,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#45976 - 2003-09-24 10:21 AM Re: Capture Network Printouts
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Here's one method.

Create a dummy printer queue, which always has printing suspended.

Poll the queue every x minutes, and if a job arrives which is under the maximum page count move it to the users local printer, otherwise move the job to the high capacity printer.

I'm assuming that there is a scriptable "move print job" call [Smile]

The problem with this is that the dummy printer, local printer and high capacity printer will all need to use the same printer driver.

Another method would be to change the printer port used for each print job, but I can see quite a few problems with controlling that one.

Top
#45977 - 2003-09-25 12:18 AM Re: Capture Network Printouts
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
I never have worked with this application but it does what you want:

"Load Balancing

APM can also be used for load balancing. You can move jobs to another printer when a certain number of documents or a specific byte size has been reached."

Print Queue Manager
_________________________
Co


Top
#45978 - 2003-09-24 05:18 PM Re: Capture Network Printouts
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could also use "Printer Pooling" which is kind-of load-balancing.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.105 seconds in which 0.059 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org