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