1 <samba:parameter xmlns:samba="http://samba.org/common">
2 <term><anchor id="ADDPRINTERCOMMAND"/>addprinter command (G)</term>
3 <listitem><para>With the introduction of MS-RPC based printing
4 support for Windows NT/2000 clients in Samba 2.2, The MS Add
5 Printer Wizard (APW) icon is now also available in the
6 "Printers..." folder displayed a share listing. The APW
7 allows for printers to be add remotely to a Samba or Windows
8 NT/2000 print server.</para>
10 <para>For a Samba host this means that the printer must be
11 physically added to the underlying printing system. The <parameter moreinfo="none">add
12 printer command</parameter> defines a script to be run which
13 will perform the necessary operations for adding the printer
14 to the print system and to add the appropriate service definition
15 to the <filename moreinfo="none">smb.conf</filename> file in order that it can be
16 shared by <citerefentry><refentrytitle>smbd</refentrytitle>
17 <manvolnum>8</manvolnum></citerefentry>.</para>
19 <para>The <parameter moreinfo="none">addprinter command</parameter> is
20 automatically invoked with the following parameter (in
24 <listitem><para><parameter moreinfo="none">printer name</parameter></para></listitem>
25 <listitem><para><parameter moreinfo="none">share name</parameter></para></listitem>
26 <listitem><para><parameter moreinfo="none">port name</parameter></para></listitem>
27 <listitem><para><parameter moreinfo="none">driver name</parameter></para></listitem>
28 <listitem><para><parameter moreinfo="none">location</parameter></para></listitem>
29 <listitem><para><parameter moreinfo="none">Windows 9x driver location</parameter>
33 <para>All parameters are filled in from the PRINTER_INFO_2 structure sent
34 by the Windows NT/2000 client with one exception. The "Windows 9x
35 driver location" parameter is included for backwards compatibility
36 only. The remaining fields in the structure are generated from answers
37 to the APW questions.</para>
39 <para>Once the <parameter moreinfo="none">addprinter command</parameter> has
40 been executed, <command moreinfo="none">smbd</command> will reparse the <filename moreinfo="none">
41 smb.conf</filename> to determine if the share defined by the APW
42 exists. If the sharename is still invalid, then <command moreinfo="none">smbd
43 </command> will return an ACCESS_DENIED error to the client.</para>
46 The "add printer command" program can output a single line of text,
47 which Samba will set as the port the new printer is connected to.
48 If this line isn't output, Samba won't reload its printer shares.
51 <para>See also <link linkend="DELETEPRINTERCOMMAND"><parameter moreinfo="none">
52 deleteprinter command</parameter></link>, <link linkend="PRINTING"><parameter moreinfo="none">printing</parameter></link>,
53 <link linkend="SHOWADDPRINTERWIZARD"><parameter moreinfo="none">show add
54 printer wizard</parameter></link></para>
56 <para>Default: <emphasis>none</emphasis></para>
57 <para>Example: <command moreinfo="none">addprinter command = /usr/bin/addprinter