Difference between revisions of "Cool Solution - Printer assignment"

From Univention Wiki

Jump to: navigation, search
(Update)
Line 1: Line 1:
{{Cool Solutions Disclaimer|Repository=yes|UCS=3.0}}
+
{{Version|UCS=3.2}}
This article is about the '''univention-printer-assignment''' package, as well as the functions of this package and the handling on the site of Windows Systems.
+
{{Cool Solutions Disclaimer|Repository=yes}}
The package '''univention-printer-assignment''' searches over the LDAP service for all printers in the network and sorts them in alphabetic order according to their group affiliation. The printer that was added first, in the alphabetic first group will be set as the default printer.
+
{{Review-Status}}
 +
 
 +
The package '''univention-printer-assignment''' adds the functionality to your system to assign different printers to selected groups (containing Windows clients) without connecting other printers from the domain to the list of available printers in Windows. If no group contains specific printers, all available printers are connected to the Windows system and leaves the choice of the default printer to the user.
  
 
== Installation ==
 
== Installation ==
 +
To add the printer assignment to your environment, the package '''univention-printer-assignment''' must be installed on the DC Master:
 +
<pre>
 +
univention-install univention-printer-assignment
 +
</pre>
  
The package univention-printer-assignment is available in the [[Howtos UCS 3.1|Cool Solutions Repository]] for UCS 3.0. Before installing the univention-printer-assignment package make sure that the UCR-variable '''repository/online/unmaintained''' is set to yes. To activate this variable over the UMC, search for '''*unmaintained*''' in the UCR-module. After this you have to activate the Cool-Solutions repository. To activate the Cool-Solutions repository set the variable '''repository/online/component/cool-solutions''' to yes and '''repository/online/component/cool-solutions/parts''' to unmaintained.
+
After the installation the provided join script must be run:
<syntaxhighlight lang=bash>
+
<pre>
ucr set repository/online/component/cool-solutions=yes repository/online/component/cool-solutions/parts=unmaintained
 
</syntaxhighlight>
 
To activate this variable over the UMC, search for '''*cool-solutions*''' in the UCR-module. If the search returns no results, you have to add the variable. Execute the command you see above in a command shell, in the UMC, open the UCR-module and click on the ''Add'' field and insert a variable as well as a value. The package can be installed after activating the repository:
 
[[File:Printerassign ucs 3-0.jpeg|200px|thumb|right|Assignment of a printer to the group Guests]]
 
<syntaxhighlight lang=bash>
 
univention-install univention-printer-assignment
 
</syntaxhighlight>
 
After the installation, you have to run the join-scripts, to add the ''Printer Assignment'' field to your UMC.
 
<syntaxhighlight lang=bash>
 
 
univention-run-join-scripts
 
univention-run-join-scripts
</syntaxhighlight>
+
</pre>
[[File:Groupassign.jpg|200px|thumb|right| Assignment of a computer to the group Guests]]
 
Now printers can be assigned to groups in the group administration in the ''Advanced settings'' tab. The printer definition will be distributed to the corresponding Microsoft Windows systems via Netlogon.
 
  
[[File:prntassigndebug.jpg|200px|thumb|right|Setting the debug variable on yes, by using the graphical interface]]
+
== Configuration ==
 +
Now printers can be assigned to groups, which holds the Windows clients as members. To add printers to a group, open the '''[Advanced settings]''' tab and open the module '''Printer Assignment'''. Every printer here is added to the VBS script which is later run by the Windows client.
 +
[[File:Printerassign ucs 3-0.jpeg|200px|thumb|right|Assignment of a printer to the group Guests]]
  
A feature of the univention-printer-assignment package is, that it is possible to set group-specific default printers. For that a computer and a printer (or more) have to be assigned to a group. To assign a computer to a group you have to select a group over the Group Administration in the UMC and add, in the ''Advanced settings'' in the field ''Host members'', a computer to the group. If there are printers assigned to the group an own default printer will be assigned to the group, after executing the printer-assignment.vbs script.
+
=== Netlogon scripts ===
 +
To run the printer assignment script, a generic call line must be added to the logon script. For a Samba 3 setup the path is:
 +
<pre>
 +
call %LOGONSERVER%\netlogon\printerassignment\%COMPUTERNAME%.vbs
 +
</pre>
  
With UCS 3.0 the anonymous ldap search has to be allowed, otherwise ldap can't find the DN of the computer.
+
For a Samba 4 setup, the path is
To enable the anonymous ldap search in the UMC, search for '''*anonymous*''' in the UCR-module and set the variable '''ldap/acl/read/anonymous''' to yes.
+
<pre>
To enable the anonymous ldap search in the command shell, the following command is needed:
+
call %LOGONSERVER%\sysvol\<YOUR DOMAIN>\printerassignment\%COMPUTERNAME%.vbs
<syntaxhighlight lang=bash>
+
</pre>
ucr set ldap/acl/read/anonymous=yes
 
</syntaxhighlight>
 
  
'''Netlogon scripts'''
+
''Hint:'' adjust the values according to your setting.
  
To define global netlogon scripts, the variable '''samba/logonscript''' has to be set. To activate this variable over the UMC, you have to search in the UCR-module for '''*logonscript*''' and set the '''samba/logonscript''', just by clicking at the variable and change the previous entry to yes.<br>
+
=== UCR variables ===
To set the variable in the command shell, the following command is needed:
 
<syntaxhighlight lang=bash>
 
ucr set samba/netlogon=yes
 
</syntaxhighlight>
 
  
 +
To get a full list of provided UCR variables and allowed values, search for UCR variables starting with '''printer/assignment''':
 +
<pre>
 +
ucr search --verbose printer/assignment
 +
</pre>
 +
<!-- The most important UCR variables are listed below.
  
'''Samba 3''' In Samba 3 the netlogon-scripts are stored in the directory '''/var/lib/samba/netlogon'''
+
==== Debug-mode ====
 +
Prints each executed line in a separate window. Must be confirmed before the script continues.
  
'''Samba 4''' In Samba 4 the netlogon-scripts are stored in the directory '''/var/lib/samba/sysvol/%DOMAIN NAME%/scripts'''
+
UCR variable: printer/assignment/vbs/debug<br>
 +
Allowed values: yes, no
  
For the univention-printer-assignment package are variables available, that can be set for testing the functions of this package.
+
==== Remove all ====
 +
Removes all printers before adding new ones. If users are to choose their own default printer, this option should be turned off.
  
'''Debug-mode'''
+
UCR variable: printer/assignment/vbs/removeall<br>
To enter the Debug-mode in the UMC, you have to search for '''*assignment*''' and set the variable '''printer/assignment/debug''' on yes.<br>
+
Allowed values: yes, no
To enter the debug-mode in the command shell, the following command is needed:
 
<syntaxhighlight lang=bash>
 
ucr set printer/assignment/debug=yes
 
</syntaxhighlight>
 
  
'''Removeall'''[[File:prntassigndebug.jpg|200px|thumb|right|Setting the removeall variable on yes, by using the graphical interface]]
+
==== Set default printer ====
Another feature of the '''univention-printer-assigment''' package is the removeall variable. If this variable is set, the '''printer-assignment.vbs''' will be executed, all printers in the network will be deleted from the printer overview and new printers will be added in the printer overview.<br>
+
If a group has a printer selected in the UMC, that printer is made the default printer, regardless of the user's setting.
To activate this variable over the UMC, you have to search in the UCR-module for '''*assignment*''' and set the
 
'''printer/assignment/removeall''' on yes.
 
<br>
 
To set the variable in the command shell, the following command is needed:
 
<syntaxhighlight lang=bash>
 
ucr set printer/assigment/removeall=yes
 
</syntaxhighlight>
 
  
'''Windows'''
+
UCR variable: printer/assignment/vbs/setdefaultprinter<br>
The '''printer-assignment.vbs''' script is found in the network on the logon server in directory '''\\%LOGONSERVER%\netlogon'''. It is sufficient to execute the file as the domain administrator. The sorting of the printers, as well as the setting of an default printer are processed automatically.
+
Allowed values: yes, no -->
 
 
'''Please Note:''' The univention-printer-assignment package works only correct with Windows XP (or with earlier versions) with a 32-Bit architecture. With Windows 7 (wether 32- or 64-Bit) the package doesn't work.
 
 
 
== Configuration ==
 
 
 
For the VB-script to work, a new group must be added. This group includes the users that are allowed to execute the script, the computers on which the script is executed and the printers whereas the first printer in the list is set as the default printer.
 
 
 
The allowed useres are assigned, as in any other group, on the first page of the group configuration dialog, the allowed computers and the printers are assigned on the '''[Advanced settings]''' tab in '''Host members''' and '''Printer Assignment'''. After the changes are saved, the slapd must be restarted on the server:
 
<pre>
 
invoke-rc.d slapd restart
 
</pre>
 
The next time the script '''printer-assignment.vbs''' is executed the printer, that was added first into the group, will be set as default printer in MS Windows.
 
  
[[Category:Cool Solutions Repository]]
 
 
[[Category:EN]]
 
[[Category:EN]]

Revision as of 08:10, 2 September 2014

Produktlogo UCS Version 3.2

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Packages provided by a Cool Solutions Repository are built by Univention, but will not be maintained. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.
Note: This article is not yet reviewed.


The package univention-printer-assignment adds the functionality to your system to assign different printers to selected groups (containing Windows clients) without connecting other printers from the domain to the list of available printers in Windows. If no group contains specific printers, all available printers are connected to the Windows system and leaves the choice of the default printer to the user.

Installation

To add the printer assignment to your environment, the package univention-printer-assignment must be installed on the DC Master:

univention-install univention-printer-assignment

After the installation the provided join script must be run:

univention-run-join-scripts

Configuration

Now printers can be assigned to groups, which holds the Windows clients as members. To add printers to a group, open the [Advanced settings] tab and open the module Printer Assignment. Every printer here is added to the VBS script which is later run by the Windows client.

Assignment of a printer to the group Guests

Netlogon scripts

To run the printer assignment script, a generic call line must be added to the logon script. For a Samba 3 setup the path is:

call %LOGONSERVER%\netlogon\printerassignment\%COMPUTERNAME%.vbs

For a Samba 4 setup, the path is

call %LOGONSERVER%\sysvol\<YOUR DOMAIN>\printerassignment\%COMPUTERNAME%.vbs

Hint: adjust the values according to your setting.

UCR variables

To get a full list of provided UCR variables and allowed values, search for UCR variables starting with printer/assignment:

ucr search --verbose printer/assignment
Personal tools