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 login 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:
Please see below to read more about these options.
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:
loginscript.vbs
'
' 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 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:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup
Dim oNet
Set oNet = CreateObject("WScript.Network")
oNet.AddWindowsPrinterConnection "\\MainServer\LibaryColor"
oNet.AddWindowsPrinterConnection "\\MainServer\LibaryHP"
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:
Examples:
rundll32 printui.dll,PrintUIEntry /n\\MainServer\HPLaserJrundll32 printui.dll,PrintUIEntry /in /n\\MainServer\HPLaserJ
To remove a printer:
rundll32 printui.dll,PrintUIEntry /dn /n\\MainServer\HPLaserJ
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:
rundll32 printui.dll,PrintUIEntry /ga /n\\server\printer where server and printer make up the correct UNC path to the printer.
net stop spooler
net start spooler
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