Automating printer management in a school, university or education environment

KB Home   |   Automating printer management in a school, university or education environment

In a business environment a user usually has a desktop PC dedicated to their use. Their printers can be configured either manually under their profile, or automatically via a login script. Such a ‘privilege’ is not common in an education environment, and hence different management methods are required to effectively map printers.

In an education environment users roam between computer labs and locations. The printers listed under Start→Settings→Printers should change depending on what computer they are using. For example, it is not appropriate to list the science lab printer when the user is logged in across campus in the library. In other words, the list of printers is a function of location rather than user identity. Network administrators working in education need to jump through a few more hoops to configure the ideal network setup.

There are a number of ways to address the “roaming user - changing printers” problem. Options include:

Option 1) An adaptive login script that installs different printers dependent on the computer name.
Option 2) A machine specific script configured to run when a user logs in.
Option 3) Install the printers in a global context so all users that log onto the machine have the convenient printers listed.

Please see below to read more about these options.

Option 1)

Writing an adaptive login script is a good solution for small to medium sized networks or networks where computers are named using a convention related to location. This solution has been adopted by PaperCut users with small networks. Frank from Rowland Medical Library has contributed an example that uses con2prt.

Another alternative is to use a VBScript based logon script that leverages a consistent workstation naming system. An example follows:


 ' A Login script to set up printers based on location.
 Dim oNet
 Set oNet = CreateObject("WScript.Network")
 Dim strComputerName
 strComputerName = oNet.ComputerName

 ' If computer is in the science lab (ie. a computer name starting with 
 ' SCI_LAB then add the science lap laser printer.
 If InStr(strComputerName, "SCI_LAB") > 1 Then
     oNet.AddWindowsPrinterConnection "\\MainServer\SCI_LAB_Laser"
 End If

 ' If in library then add library printers
 If InStr(strComputerName, "LIBRARY") > 1 Then
     oNet.AddWindowsPrinterConnection "\\MainServer\LibraryHP"
     oNet.AddWindowsPrinterConnection "\\MainServer\LibraryColor"
 End If

Administrator should use group policies to define the login script. More information is available at:

Option 2)

Option two involves running a machine specific script when a user logs in. For example, all workstation in the science lab will run a script that installs the relevant printers. Workstations in the library would run another script to add the library’s printers. The simplest way to instigate these scripts is via the All Users Startup folder as follows:

1. Log into the workstation as administrator
2. Navigate to C:\Documents and Settings\All Users\Start Menu\Programs\Startup
3. Create a script that sets up the called setup-printers.vbs that sets up the required printers. Example:
        Dim oNet
        Set oNet = CreateObject("WScript.Network")
        oNet.AddWindowsPrinterConnection "\\MainServer\LibaryColor"
        oNet.AddWindowsPrinterConnection "\\MainServer\LibaryHP"

4. Log off as Administrator and log in as a normal user. Verify that printers are available.

Alternate Option:

As an alternative to VBScript, the same task can be undertaken in a batch file using the PrintUIEntry function of printui.dll. This is detailed at:


 rundll32 printui.dll,PrintUIEntry /n\\MainServer\HPLaserJ 
 rundll32 printui.dll,PrintUIEntry /in /n\\MainServer\HPLaserJ 

To remove a printer:

 rundll32 printui.dll,PrintUIEntry /dn /n\\MainServer\HPLaserJ 

Option 3)

Windows 2000, XP and 2003 all have the capability to install a printer and have it globally available to all users (Similar to the way printers worked in the old Windows 95/98 days). Unfortunately the Add Printer wizard does not expose this functionality and only adds the printer for the current user. The command-line needs to be used to install and expose a printer globally. The process is as follows:

1. Log on to the workstation as an Administrator
2. Start→Run and enter “cmd” then press OK
3. Type rundll32 printui.dll,PrintUIEntry /ga /n\\server\printer where server and printer make up the correct UNC path to the printer.
4. Restart the spooler service with the commands:
        net stop spooler
        net start spooler

5. The printer should now be listed and available to all users that log onto the workstation.
6. Note that printers added like this will have to be removed with the corresponding command rundll32 printui.dll,PrintUIEntry /gd /n\\server\printer. Note the /gd instead of /ga. After issuing this command, the printer will be removed at the next logon.

Please also check out our print quota and print management software applications. These applications are also of great benefit in an education environment.

Categories: Administration, Scripting

Keywords: adding printers, login script, netlogon, printer setup, user profiles, network management, k12 network, academic networks, school printers, mapping printers, logon script


Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.

Article last modified on August 03, 2010, at 06:43 PM
Printable View   |   Article History   |   Edit Article