Setting up Network Printer Ports: Difference between revisions
Mmuehlfeld (talk | contribs) (Rewrote documentation. Used clearer structure. Added some additional details, used updated image.) |
No edit summary |
||
(22 intermediate revisions by 2 users not shown) | |||
Line 19: | Line 19: | ||
* You can write a script that generates the port names from configuration files, databases, or other sources. |
* You can write a script that generates the port names from configuration files, databases, or other sources. |
||
* It's possible to use the enumport script so that the windows driver can communicate with the printer (automatic discovery of the real printer model, automatic discovery of installed options on the printer or authentication on printer before printing, with snmp or other protocol used by the windows driver). For example: |
|||
#!/bin/bash |
|||
echo "Samba Printer Port" |
|||
echo "\\\\IP_address_of_DemoPrinter1" |
|||
echo "\\\\IP_address_of_DemoPrinter2" |
|||
echo "\\\\IP_address_of_DemoPrinter3" |
|||
The second line "echo "Samba Printer Port"" is optionnal if you want to keep this port in the list of possible choices. |
|||
And if you want that "My users and my boss must not know that they work with Samba", remove this line ! |
|||
{{Imbox |
{{Imbox |
||
Line 24: | Line 36: | ||
| text = Every line the script outputs is used as a printer port. Make sure that the script does not output other content. |
| text = Every line the script outputs is used as a printer port. Make sure that the script does not output other content. |
||
}} |
}} |
||
= Setting up Printer Ports = |
= Setting up Printer Ports = |
||
Line 52: | Line 60: | ||
For details, see [[Setting_up_Automatic_Printer_Driver_Downloads_for_Windows_Clients#Preconfiguring_a_Printer|Preconfiguring a Printer]]. |
For details, see [[Setting_up_Automatic_Printer_Driver_Downloads_for_Windows_Clients#Preconfiguring_a_Printer|Preconfiguring a Printer]]. |
||
---- |
|||
[[Category:Active Directory]] |
|||
[[Category:Domain Members]] |
|||
[[Category:NT4 Domains]] |
|||
[[Category:Printing]] |
|||
[[Category:Standalone Server]] |
Latest revision as of 18:07, 5 March 2023
Introduction
In Windows, printers must have a port assigned. This can be a local port, such as LPT1
, or for example for a remote port, LPD Port Monitor
. Per default, Samba auto-generates the Samba Printer Port
for all shared printers. However, in certain scenarios, you require to use unique port names.
How Samba Provides Custom Ports to the Windows Hosts
Samba enables you to use a script that outputs only the port names:
- The script can only output the port names by using
echo
commands. For example:
#!/bin/bash echo "DemoPrinter1" echo "DemoPrinter2" echo "DemoPrinter3"
- You can write a script that generates the port names from configuration files, databases, or other sources.
- It's possible to use the enumport script so that the windows driver can communicate with the printer (automatic discovery of the real printer model, automatic discovery of installed options on the printer or authentication on printer before printing, with snmp or other protocol used by the windows driver). For example:
#!/bin/bash echo "Samba Printer Port" echo "\\\\IP_address_of_DemoPrinter1" echo "\\\\IP_address_of_DemoPrinter2" echo "\\\\IP_address_of_DemoPrinter3"
The second line "echo "Samba Printer Port"" is optionnal if you want to keep this port in the list of possible choices.
And if you want that "My users and my boss must not know that they work with Samba", remove this line !
![]() | Every line the script outputs is used as a printer port. Make sure that the script does not output other content. |
Setting up Printer Ports
To enable Samba to display individual printer ports:
- Create a shell script. For example,
/usr/local/bin/samba-ports.sh
that outputs each port in a new line. For details, see How Samba Provides Custom Ports to the Windows Hosts.
- Make the script executable:
# chmod 755 /usr/local/bin/samba-ports.sh
- Add the following parameter to the
[global]
section in yoursmb.conf
file:
enumports command = /usr/local/bin/samba-ports.sh
- Reload Samba:
# smbcontrol all reload-config
The ports are now usable in the properties when preconfiguring a printer.
For details, see Preconfiguring a Printer.