Controlling printer access based on time

This knowledge base article related to PaperCut NG.

PaperCut NG comes with a comprehensive set of XML web services API's and a set of command-line tools for use in traditional scripting environments such as batch files or shell scripts. These tools can be used to control accounts, settings and printer access. One example of their use is controlling printer access based on time of day. Here is an example on how to set this up:

This example assumes:

  • PaperCut NG is set up on a Windows print server named "printsrv1"
  • There is a printer access on the server called "labprinter"
  • The administrator would like the printer disabled between 5:00pm and 8:00am on week days.
1. Log into the server as administrator
2. Create two text files (renamed to bat files) called:
         open-printer-access.bat
         close-printer-access.bat
in the location C:\Program Files\PaperCut NG\server\custom
3. In close-printer-access.bat add the text:
         cd c:\program files\papercut ng\server\bin\win
         server-command.exe disable-printer "printsrv1" "labprinter" "-1"
Note: The value -1 indicates to disable the printer forever - that is until is is manually re-enabled.
4. In open-printer-access.bat add the text:
         cd c:\program files\papercut ng\server\bin\win
         server-command.exe enable-printer "printsrv1" "labprinter"
5. Double-click on close-printer-access.bat and verify that the printer is disabled and printing is denied. Then Double-click on open-printer-access.bat and verify that printing is re-enabled.
6. Use the Windows Task Scheduler under Start->Control Panel->Scheduled Tasks to add two new tasks as follows:
  • Schedule close-printer-access.bat to run on at 5:00pm on weekdays.
  • Schedule open-printer-access.bat to run on at 8:00am on weekdays.
Note: More information on the Windows Task Scheduler in the Windows help system.

For more information see Scheduling server commands.

Categories: Printers

Page last modified on October 05, 2008, at 08:50 PM