9205439b0138262d24928e2be7e26218dc97669e
[samba.git] / docs / docbook / manpages / rpcclient.1.sgml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
2 <refentry id="rpcclient">
3
4 <refmeta>
5         <refentrytitle>rpcclient</refentrytitle>
6         <manvolnum>1</manvolnum>
7 </refmeta>
8
9
10 <refnamediv>
11         <refname>rpcclient</refname>
12         <refpurpose>tool for executing client side 
13         MS-RPC functions</refpurpose>
14 </refnamediv>
15
16 <refsynopsisdiv>
17         <cmdsynopsis>
18                 <command>rpcclient</command>
19                 <arg choice="opt">-A authfile</arg>
20                 <arg choice="opt">-c &lt;command string&gt;</arg>
21                 <arg choice="opt">-d debuglevel</arg>
22                 <arg choice="opt">-h</arg>
23                 <arg choice="opt">-l logfile</arg>
24                 <arg choice="opt">-N</arg>
25                 <arg choice="opt">-s &lt;smb config file&gt;</arg>
26                 <arg choice="opt">-U username[%password]</arg>
27                 <arg choice="opt">-W workgroup</arg>
28                 <arg choice="opt">-N</arg>
29                 <arg choice="req">server</arg>
30         </cmdsynopsis>
31 </refsynopsisdiv>
32
33 <refsect1>
34         <title>DESCRIPTION</title>
35
36         <para>This tool is part of the <ulink url="samba.7.html">
37         Samba</ulink> suite.</para>
38
39         <para><command>rpcclient</command> is a utility initially developed
40         to test MS-RPC functionality in Samba itself.  It has undergone 
41         several stages of development and stability.  Many system administrators
42         have now written scripts around it to manage Windows NT clients from 
43         their UNIX workstation. </para>
44 </refsect1>
45
46
47 <refsect1>
48         <title>OPTIONS</title>
49
50         <variablelist>
51                 <varlistentry>
52                 <term>server</term>
53                 <listitem><para>NetBIOS name of Server to which to connect. 
54                 The server can be  any SMB/CIFS server.  The name is 
55                 resolved using the <ulink url="smb.conf.5.html#NAMERESOLVEORDER">
56                 <parameter>name resolve order</parameter></ulink> line from 
57                 <filename>smb.conf(5)</filename>.</para></listitem>
58                 </varlistentry>
59
60
61                 <varlistentry>
62                 <term>-A|--authfile=filename</term>
63                 <listitem><para>This option allows 
64                 you to specify a file from which to read the username and 
65                 password used in the connection.  The format of the file is 
66                 </para>
67                 
68                 <para><programlisting>
69                 username = &lt;value&gt; 
70                 password = &lt;value&gt;
71                 domain   = &lt;value&gt;
72                 </programlisting></para>
73         
74                 <para>Make certain that the permissions on the file restrict 
75                 access from unwanted users. </para></listitem>
76                 </varlistentry>
77
78
79
80                 <varlistentry>
81                 <term>-c|--command='command string'</term>
82                 <listitem><para>execute semicolon separated commands (listed 
83                 below)) </para></listitem>
84                 </varlistentry>
85                 
86                                 
87                 
88
89                 <varlistentry>
90                 <term>-d|--debug=debuglevel</term>
91                 <listitem><para>set the debuglevel. Debug level 0 is the lowest 
92                 and 100 being the highest. This should be set to 100 if you are
93                 planning on submitting a bug report to the Samba team (see <filename>BUGS.txt</filename>). 
94                 </para></listitem>
95                 </varlistentry>
96                 
97         
98
99
100                 <varlistentry>
101                 <term>-h|--help</term>
102                 <listitem><para>Print a summary of command line options.
103                 </para></listitem>
104                 </varlistentry>
105
106
107
108                 
109                 <varlistentry>
110                 <term>-l|--logfile=logbasename</term>
111                 <listitem><para>File name for log/debug files. The extension 
112                 <constant>'.client'</constant> will be appended. The log file is never removed  
113                 by the client.
114                 </para></listitem>
115                 </varlistentry>
116
117
118                 
119                 <varlistentry>
120                 <term>-N|--nopass</term>
121                 <listitem><para>instruct <command>rpcclient</command> not to ask 
122                 for a password.   By default, <command>rpcclient</command> will prompt 
123                 for a password.  See also the <parameter>-U</parameter> option.</para></listitem>
124                 </varlistentry>
125
126                 
127                 <varlistentry>
128                 <term>-s|--conf=smb.conf</term>
129                 <listitem><para>Specifies the location of the all important 
130                 <filename>smb.conf</filename> file. </para></listitem>
131                 </varlistentry>
132
133                                 
134
135                 <varlistentry>
136                 <term>-U|--user=username[%password]</term>
137                 <listitem><para>Sets the SMB username or username and password. </para>
138                 
139                 <para>If %password is not specified, the user will be prompted. The 
140                 client will first check the <envar>USER</envar> environment variable, then the 
141                 <envar>LOGNAME</envar> variable and if either exists, the 
142                 string is uppercased. If these environmental variables are not 
143                 found, the username <constant>GUEST</constant> is used. </para>
144
145                 <para>A third option is to use a credentials file which 
146                 contains the plaintext of the username and password.  This 
147                 option is mainly provided for scripts where the admin doesn't 
148                 desire to pass the credentials on the command line or via environment 
149                 variables. If this method is used, make certain that the permissions 
150                 on the file restrict access from unwanted users.  See the 
151                 <parameter>-A</parameter> for more details. </para>
152                 
153                 <para>Be cautious about including passwords in scripts. Also, on 
154                 many systems the command line of a running process may be seen 
155                 via the <command>ps</command> command.  To be safe always allow 
156                 <command>rpcclient</command> to prompt for a password and type 
157                 it in directly. </para></listitem>
158                 </varlistentry>
159                 
160                 
161                 
162                 
163                 <varlistentry>
164                 <term>-W|--workgroup=domain</term>
165                 <listitem><para>Set the SMB domain of the username.   This 
166                 overrides the default domain which is the domain defined in 
167                 smb.conf.  If the domain specified is the same as the server's NetBIOS name, 
168                 it causes the client to log on using the  server's local SAM (as 
169                 opposed to the Domain SAM). </para></listitem>
170                 </varlistentry>
171                 
172                                                 
173         </variablelist>
174 </refsect1>
175
176
177 <refsect1>
178         <title>COMMANDS</title>
179
180         <para><emphasis>LSARPC</emphasis></para>
181         <itemizedlist>
182                 <listitem><para><command>lsaquery</command></para></listitem>
183                 
184                 <listitem><para><command>lookupsids</command> - Resolve a list 
185                 of SIDs to usernames.
186                 </para></listitem>
187                 
188                 <listitem><para><command>lookupnames</command> - Resolve s list 
189                 of usernames to SIDs.
190                 </para></listitem>
191                 
192                 <listitem><para><command>enumtrusts</command></para></listitem>
193         </itemizedlist> 
194         <para> </para>
195         
196
197
198         <para><emphasis>SAMR</emphasis></para>
199         <itemizedlist>
200                 <listitem><para><command>queryuser</command></para></listitem>
201                 <listitem><para><command>querygroup</command></para></listitem>
202                 <listitem><para><command>queryusergroups</command></para></listitem>
203                 <listitem><para><command>querygroupmem</command></para></listitem>
204                 <listitem><para><command>queryaliasmem</command></para></listitem>
205                 <listitem><para><command>querydispinfo</command></para></listitem>
206                 <listitem><para><command>querydominfo</command></para></listitem>
207                 <listitem><para><command>enumdomgroups</command></para></listitem>
208         </itemizedlist>
209         <para> </para>
210
211
212
213         <para><emphasis>SPOOLSS</emphasis></para>
214
215         <itemizedlist>
216                 <listitem><para><command>adddriver &lt;arch&gt &lt;config&gt;</command> 
217                 - Execute an AddPrinterDriver() RPC to install the printer driver 
218                 information on the server.  Note that the driver files should 
219                 already exist in the directory returned by  
220                 <command>getdriverdir</command>.  Possible values for 
221                 <parameter>arch</parameter> are the same as those for 
222                 the <command>getdriverdir</command> command.
223                 The <parameter>config</parameter> parameter is defined as 
224                 follows: </para>
225                 
226                 <para><programlisting>
227                 Long Printer Name:\
228                 Driver File Name:\
229                 Data File Name:\
230                 Config File Name:\
231                 Help File Name:\
232                 Language Monitor Name:\
233                 Default Data Type:\
234                 Comma Separated list of Files
235                 </programlisting></para>
236
237                 <para>Any empty fields should be enter as the string "NULL". </para>
238                 
239                 <para>Samba does not need to support the concept of Print Monitors
240                 since these only apply to local printers whose driver can make
241                 use of a bi-directional link for communication.  This field should 
242                 be "NULL".   On a remote NT print server, the Print Monitor for a 
243                 driver must already be installed prior to adding the driver or 
244                 else the RPC will fail. </para></listitem>
245
246
247                 
248                 
249                 <listitem><para><command>addprinter &lt;printername&gt; 
250                 &lt;sharename&gt; &lt;drivername&gt; &lt;port&gt;</command> 
251                 - Add a printer on the remote server.  This printer 
252                 will be automatically shared.  Be aware that the printer driver 
253                 must already be installed on the server (see <command>adddriver</command>) 
254                 and the <parameter>port</parameter>must be a valid port name (see
255                 <command>enumports</command>.</para>
256                 </listitem>
257
258
259                 <listitem><para><command>deldriver</command> - Delete the 
260                 specified printer driver for all architectures.  This
261                 does not delete the actual driver files from the server,
262                 only the entry from the server's list of drivers.
263                 </para></listitem>
264
265                 <listitem><para><command>enumdata</command> - Enumerate all 
266                 printer setting data stored on the server. On Windows NT  clients, 
267                 these values are stored  in the registry, while Samba servers 
268                 store them in the printers TDB.  This command corresponds
269                 to the MS Platform SDK GetPrinterData() function (* This
270                 command is currently unimplemented).</para></listitem>
271
272
273
274                 <listitem><para><command>enumjobs &lt;printer&gt;</command> 
275                 - List the jobs and status of a given printer.  
276                 This command corresponds to the MS Platform SDK EnumJobs() 
277                 function (* This command is currently unimplemented).</para></listitem>
278                 
279
280
281                 
282                 <listitem><para><command>enumports [level]</command> 
283                 - Executes an EnumPorts() call using the specified 
284                 info level. Currently only info levels 1 and 2 are supported. 
285                 </para></listitem>
286
287
288
289                 <listitem><para><command>enumdrivers [level]</command> 
290                 - Execute an EnumPrinterDrivers() call.  This lists the various installed 
291                 printer drivers for all architectures.  Refer to the MS Platform SDK 
292                 documentation for more details of the various flags and calling 
293                 options. Currently supported info levels are 1, 2, and 3.</para></listitem>
294
295
296
297                 <listitem><para><command>enumprinters [level]</command> 
298                 - Execute an EnumPrinters() call.  This lists the various installed 
299                 and share printers.  Refer to the MS Platform SDK documentation for 
300                 more details of the various flags and calling options. Currently
301                 supported info levels are 0, 1, and 2.</para></listitem>
302
303
304
305
306                 <listitem><para><command>getdata &lt;printername&gt;</command> 
307                 - Retrieve the data for a given printer setting.  See 
308                 the  <command>enumdata</command> command for more information.  
309                 This command corresponds to the GetPrinterData() MS Platform 
310                 SDK function (* This command is currently unimplemented). </para></listitem>
311
312
313                 
314                 <listitem><para><command>getdriver &lt;printername&gt;</command> 
315                 - Retrieve the printer driver information (such as driver file, 
316                 config file, dependent files, etc...) for 
317                 the given printer. This command corresponds to the GetPrinterDriver()
318                 MS Platform  SDK function. Currently info level 1, 2, and 3 are supported.
319                 </para></listitem>
320         
321
322                 <listitem><para><command>getdriverdir &lt;arch&gt;</command> 
323                 - Execute a GetPrinterDriverDirectory()
324                 RPC to retreive the SMB share name and subdirectory for 
325                 storing printer driver files for a given architecture.  Possible 
326                 values for <parameter>arch</parameter> are "Windows 4.0" 
327                 (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
328                 Alpha_AXP", and "Windows NT R4000". </para></listitem>
329
330
331
332                 <listitem><para><command>getprinter &lt;printername&gt;</command> 
333                 - Retrieve the current printer information.  This command 
334                 corresponds to the GetPrinter() MS Platform SDK function. 
335                 </para></listitem>
336
337
338                 
339                 <listitem><para><command>openprinter &lt;printername&gt;</command> 
340                 - Execute an OpenPrinterEx() and ClosePrinter() RPC 
341                 against a given printer. </para></listitem> 
342
343
344                 <listitem><para><command>setdriver &lt;printername&gt; &lt;drivername&gt;</command> 
345                 - Execute a SetPrinter() command to update the printer driver associated
346                 with an installed printer.  The printer driver must already be correctly
347                 installed on the print server.  </para>
348
349                 <para>See also the <command>enumprinters</command> and 
350                 <command>enumdrivers</command> commands for obtaining a list of
351                 of installed printers and drivers.</para></listitem>
352
353         </itemizedlist>
354
355
356         <para><emphasis>GENERAL OPTIONS</emphasis></para>
357
358         <itemizedlist>
359                 <listitem><para><command>debuglevel</command> - Set the current debug level
360                 used to log information.</para></listitem>
361
362                 <listitem><para><command>help (?)</command> - Print a listing of all 
363                 known commands or extended help  on a particular command. 
364                 </para></listitem>
365                 
366                 <listitem><para><command>quit (exit)</command> - Exit <command>rpcclient
367                 </command>.</para></listitem>
368         </itemizedlist>
369
370
371 </refsect1>
372
373 <refsect1>
374         <title>BUGS</title>
375         
376         <para><command>rpcclient</command> is designed as a developer testing tool 
377         and may not be robust in certain areas (such as command line parsing).  
378         It has been known to  generate a core dump upon failures when invalid 
379         parameters where passed to the interpreter. </para>
380
381         <para>From Luke Leighton's original rpcclient man page:</para>
382         
383         <para><emphasis>"WARNING!</emphasis> The MSRPC over SMB code has 
384         been developed from examining  Network traces. No documentation is 
385         available from the original creators  (Microsoft) on how MSRPC over 
386         SMB works, or how the individual MSRPC services  work. Microsoft's 
387         implementation of these services has been demonstrated  (and reported) 
388         to be... a bit flaky in places. </para>
389
390         <para>The development of Samba's implementation is also a bit rough, 
391         and as more  of the services are understood, it can even result in 
392         versions of  <command>smbd(8)</command> and <command>rpcclient(1)</command> 
393         that are incompatible for some commands or  services. Additionally, 
394         the developers are sending reports to Microsoft,  and problems found 
395         or reported to Microsoft are fixed in Service Packs,  which may 
396         result in incompatibilities." </para>
397 </refsect1>
398
399
400 <refsect1>
401         <title>VERSION</title>
402
403         <para>This man page is correct for version 3.0 of the Samba 
404         suite.</para>
405 </refsect1>
406
407 <refsect1>
408         <title>AUTHOR</title>
409         
410         <para>The original Samba software and related utilities 
411         were created by Andrew Tridgell. Samba is now developed
412         by the Samba Team as an Open Source project similar 
413         to the way the Linux kernel is developed.</para>
414         
415         <para>The original rpcclient man page was written by Matthew 
416         Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter.  
417         The conversion to DocBook for Samba 2.2 was done by Gerald 
418         Carter.</para>
419 </refsect1>
420
421 </refentry>