Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)8456 446 800 / +44 (0)1223 359900
E: enquiries@precedence.co.uk
Printers

Jump To: Support > KB > AD > Printers

Configuring printers

With the Precedence Login Script, printers are centrally managed and the most appropriate printer(s) selected at login time. This is done by using the name of the computer you are logging onto (it is aware of thin-client networks and uses the client name, not the application server name). The mapping between name and printer(s) is defined in a file called printers.csv which lives in the NETLOGON share on any of your domain controllers.

Basic usage

The format of the printers.csv file is very simple. Each field is separated by commas (no quotes are used). The first field is the name of the client and all subsequent fields are the printers to connect to. The first printer specified will be used as the default. The client name can be wildcarded by using a * character (e.g. room31-*). The file is read from top to bottom and once a clientname is matched, no further checking will be done. Therefore you must ensure that you do not put more specific entries after wildcarded entries (e.g. if you have a * catch-all, any lines after that will be ignored).

The names of the printers correspond to shared printers on a print-server. The print server is defined in the Login Script. If a particular printer is on a different print-server, then you can specify this by putting \\otherserver\ at the start of the printer name.

We recommend editing the file using Notepad. If you use a spreadsheet (e.g. Microsoft Excel), it will probably add quotes around the printer names.

N.B. You may need to ensure that your computers have the relevant drivers installed for all the printers they will connect to. This can be easily done by logging in as administrator and connecting to all the printers on the print server.

An example file:

room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

room31-01 will be given access to two printers with room31-colour as the default. All other computers in Room 31 will only have access to room31-colour. Similarly, computers in Room 32 will only have access to room32-colour. Admin computers will print to a printer on a different server. Any other computers will print to a catch-all printer.

Advanced usage

It is also possible to incorporate username and group name matching into the CSV file by adding special instructions in-place of printer names, while still retaining the original rules described above. The first CSV field will still need to match the name clientname, but all other fields may contain special instructions or printer names.

The follow instructions modify how additional printers will be added:

:preAdd new printers at the beginning of the selection list
:midAdd new printers in the normal way
:postAdd new printers at the end of the selection list

The following instructions perform group or username checks and stop processing the current CSV line if the match fails:

u+usernameTest the username against the wildcard pattern 'username'
g+groupnameTest for group membership of any group matching the wildcard pattern 'groupname'

The following instructions perform group or username checks which will disable printer selection for the remainder of the line if the match fails:

u|usernameTest the username against the wildcard pattern 'username'
g|groupnameTest for group membership of any group matching the wildcard pattern 'groupname'

To negate the the result of a username or group membership test, the entire instruction may be prefixed with "!".

Combining these rules will allow conditional mapping of printers based on users and groups, the most typical use case being to add additional printers when a user is a member of a specific group. In this example, members of the group ReproGroup will get the printer ReproPrinter as an additional printer:

*,:post,g+ReproGroup,ReproPrinter
room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

If the additional printer should be set as the default printer, using :pre instead of :post will add the printer to the beginning of the printer list:

*,:pre,g+ReproGroup,ReproPrinter
room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

If users should be member of multiple groups in order to get the additional printer, add the group name tests for all of the groups. In this example, members of the group Staff who are also members of the group ReproGroup will get the printer ReproPrinter as an additional printer:

*,:post,g+Staff,g+ReproGroup,ReproPrinter
room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

Negating the result of a test may be useful where group memberships overlap. In this example, members of the group InkWasters will not get the printer ReproPrinter as an additional printer even if they are a member of the group ReproGroup:

*,:post,!g+InkWasters,g+ReproGroup,ReproPrinter
room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

Using g| instead of g+ will allow later match instructions to run instead of skipping the current CSV line. Printer selection is disabled for the current CSV line when a match fails, but is re-enabled when a match succeeds. In this example, members of the group Staff will get the StaffRoom printer as an additional printer, and members of the group ReproGroup will get the ReproPrinter printer as an additional printer:

*,:post,g|Staff,StaffRoom,g+ReproGroup,ReproPrinter
room31-01,room31-colour,StaffRoom
room31-*,room31-colour
room32-*,room32-colour
admin-*,\\adminserver\photocopier
*,ICT-colour

Note that the StaffRoom printer is potentially selected twice, once based on group membership and once based on the clientname being room31-01. When the final printer list is processed it is de-duplicated, where printers added to the front of the list with :pre take precedence over those selected by other means.

© Copyright Precedence Technologies 1999-2024
Page last modified on April 02, 2024, at 10:09 AM by mwillcock