Overview
The univention-printer-assignment package lets you control which printers appear for Windows clients in your domain.
- You can assign specific printers to selected groups or individual computers.
- Clients in those groups will only see the assigned printers.
- If no printers are assigned to a group, all domain printers are made available, and users can choose their own default printer.
Prerequisites
- Windows clients already joined to the domain.
- Printer drivers pre-installed on Windows clients.
Without drivers, Windows cannot connect to the printer.
- Optional: Configure Microsoft Point-and-Print Group Policy to allow users to install drivers locally. See Microsoft Point-and-Print documentation here.
Installation
To enable printer assignment in your environment, install the univention-printer-assignment
package along with its accompanying schema package on the DC Master. First, make sure the Cool Solution repository is enabled.
univention-install univention-printer-assignment univention-printer-assignment-schema
After installation, run the provided join script:
univention-run-join-scripts
Configuration
You can assign printers to groups that contain Windows clients, as well as to individual computer objects.
If a computer belongs to a group that has assigned printers, it will receive those printers in addition to any printers assigned directly to that computer object. This allows you to combine group-based printer access with specific individual assignments when needed.
All printers added here will be included in a VBS script that is executed later on the Windows client.
The example below shows the printer assignment dialog for a single computer object but the same interface is used for groups as well.
Reminder: See Prerequisites for driver and Point-and-Print requirements.
Note: If you experience difficulties you might also want to check out this update from Microsoft which may cause problems with network printing.
Netlogon scripts
Samba 4
Add the following line to your logon script:
call %LOGONSERVER%\sysvol\<YOUR DOMAIN>\scripts\printerassignment\%COMPUTERNAME%.vbs
Samba 3
If you are running Samba 3, use this line instead:
call %LOGONSERVER%\netlogon\printerassignment\%COMPUTERNAME%.vbs
Hint: Adjust the values according to your setting.
UCR variables
To list all UCR variables provided by the package and their possible values, run:
ucr search --verbose printer/assignment
Create a pdf printer server
Example setup for a PDF printer server in a computer room:
- Install Print server (CUPS) from the App Center.
- See Generating PDF documents from print jobs
- Install the package
univention-printserver-pdf
- Create a Generic CUPS-PDF Printer (e.g.,
pdf
) as described in the documentation.
- Follow the Configuration section above:
- Create a computer room group (e.g.,
room01
). - Attach the PDF printer.
- Add an already joined Windows client to the group.
- See Mounting of print shares in Windows clients and follow the steps very carefully. Incorrect FQDN or missing drivers will prevent the printer from connecting.
- Run
printmanagement.msc
as a Domain Administrator. - Add the printer server using its FQDN (important due to Microsoft Update MS16-087).
- When prompted to add a driver, choose Generic → MS Publisher Color Printer.
- Follow the Netlogon scripts section above or run the
.vbs
file from the Samba share manually on the Windows client to add the PDF printer.
Use a logonscript
A short example is described here, on how to create a simple logonscript:
- in sysvol share inside the “scripts” directory create a file
user.bat
- copy the
call
-command from “Netlogon scripts” into the new file and replace “<YOUR DOMAIN>
” - Modifiy a user and set
scriptpath
to the fileuser.bat
Testing & troubleshooting
After assigning printers:
- Restart the Windows client to trigger the logon script or navigate to the Samba share and run the generated
.vbs
script manually to confirm the printers are connected. - You can also browse to the domain share to confirm that printer shares are visible:
If printers do not appear:
- Check that the printer drivers are installed on the Windows client.
- Verify that the correct printers are assigned in UCS.
- Confirm the
.vbs
file exists in thesysvol/printerassignment
folder. - Review Windows Event Viewer and UCS/Samba logs for errors.