Merge from Subversion r50.
[ira/wip.git] / docs / docbook / manpages / rpcclient.1.sgml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
2 <!ENTITY % globalentities SYSTEM '../global.ent'> %globalentities;
3 ]>
4 <refentry id="rpcclient.1">
5
6 <refmeta>
7         <refentrytitle>rpcclient</refentrytitle>
8         <manvolnum>1</manvolnum>
9 </refmeta>
10
11
12 <refnamediv>
13         <refname>rpcclient</refname>
14         <refpurpose>tool for executing client side 
15         MS-RPC functions</refpurpose>
16 </refnamediv>
17
18 <refsynopsisdiv>
19         <cmdsynopsis>
20                 <command>rpcclient</command>
21                 <arg choice="opt">-A authfile</arg>
22                 <arg choice="opt">-c &lt;command string&gt;</arg>
23                 <arg choice="opt">-d debuglevel</arg>
24                 <arg choice="opt">-h</arg>
25                 <arg choice="opt">-l logfile</arg>
26                 <arg choice="opt">-N</arg>
27                 <arg choice="opt">-s &lt;smb config file&gt;</arg>
28                 <arg choice="opt">-U username[%password]</arg>
29                 <arg choice="opt">-W workgroup</arg>
30                 <arg choice="opt">-N</arg>
31                 <arg choice="opt">-I destinationIP</arg>
32                 <arg choice="req">server</arg>
33         </cmdsynopsis>
34 </refsynopsisdiv>
35
36 <refsect1>
37         <title>DESCRIPTION</title>
38
39         <para>This tool is part of the <citerefentry><refentrytitle>Samba</refentrytitle>
40         <manvolnum>7</manvolnum></citerefentry> suite.</para>
41
42         <para><command>rpcclient</command> is a utility initially developed
43         to test MS-RPC functionality in Samba itself.  It has undergone 
44         several stages of development and stability.  Many system administrators
45         have now written scripts around it to manage Windows NT clients from 
46         their UNIX workstation. </para>
47 </refsect1>
48
49
50 <refsect1>
51         <title>OPTIONS</title>
52
53         <variablelist>
54                 <varlistentry>
55                 <term>server</term>
56                 <listitem><para>NetBIOS name of Server to which to connect. 
57                 The server can be  any SMB/CIFS server.  The name is 
58                 resolved using the <ulink url="smb.conf.5.html#NAMERESOLVEORDER">
59                 <parameter>name resolve order</parameter></ulink> line from <citerefentry><refentrytitle>smb.conf</refentrytitle>
60         <manvolnum>5</manvolnum></citerefentry>.</para></listitem>
61         </varlistentry>
62
63
64                 <varlistentry>
65                 <term>-c|--command='command string'</term>
66                 <listitem><para>execute semicolon separated commands (listed 
67                 below)) </para></listitem>
68                 </varlistentry>
69
70                 
71                 <varlistentry>
72                 <term>-I IP-address</term>
73                 <listitem><para><replaceable>IP address</replaceable> is the address of the server to connect to. 
74                 It should be specified in standard "a.b.c.d" notation. </para>
75
76                 <para>Normally the client would attempt to locate a named 
77                 SMB/CIFS server by looking it up via the NetBIOS name resolution 
78                 mechanism described above in the <parameter>name resolve order</parameter> 
79                 parameter above. Using this parameter will force the client
80                 to assume that the server is on the machine with the specified IP 
81                 address and the NetBIOS name component of the resource being 
82                 connected to will be ignored. </para>
83
84                 <para>There is no default for this parameter. If not supplied, 
85                 it will be determined automatically by the client as described 
86                 above. </para></listitem>
87                 </varlistentry>
88
89                 &popt.common.samba;
90                 &popt.common.credentials;               
91                 &popt.common.connection;
92                 &stdarg.help;
93         </variablelist>
94 </refsect1>
95
96
97 <refsect1>
98         <title>COMMANDS</title>
99
100         <refsect2>
101         <title>LSARPC</title>
102
103         <variablelist>
104                 <varlistentry><term>lsaquery</term><listitem><para>Query info policy</para></listitem></varlistentry>
105                 
106                 <varlistentry><term>lookupsids</term><listitem><para>Resolve a list 
107                 of SIDs to usernames.
108                 </para></listitem></varlistentry>
109                 
110                 <varlistentry><term>lookupnames</term><listitem><para>Resolve a list 
111                 of usernames to SIDs.
112                 </para></listitem></varlistentry>
113                 
114                 <varlistentry><term>enumtrusts</term><listitem><para>Enumerate trusted domains</para></listitem></varlistentry>
115
116                 <varlistentry><term>enumprivs</term><listitem><para>Enumerate privileges</para></listitem></varlistentry>
117
118                 <varlistentry><term>getdispname</term><listitem><para>Get the privilege name</para></listitem></varlistentry>
119
120                 <varlistentry><term>lsaenumsid</term><listitem><para>Enumerate the LSA SIDS</para></listitem></varlistentry>
121
122                 <varlistentry><term>lsaenumprivsaccount</term><listitem><para>Enumerate the privileges of an SID</para></listitem></varlistentry>
123
124                 <varlistentry><term>lsaenumacctrights</term><listitem><para>Enumerate the rights of an SID</para></listitem></varlistentry>
125
126                 <varlistentry><term>lsaenumacctwithright</term><listitem><para>Enumerate accounts with a right</para></listitem></varlistentry>
127
128                 <varlistentry><term>lsaaddacctrights</term><listitem><para>Add rights to an account</para></listitem></varlistentry>
129
130                 <varlistentry><term>lsaremoveacctrights</term><listitem><para>Remove rights from an account</para></listitem></varlistentry>
131
132                 <varlistentry><term>lsalookupprivvalue</term><listitem><para>Get a privilege value given its name</para></listitem></varlistentry>
133
134                 <varlistentry><term>lsaquerysecobj</term><listitem><para>Query LSA security object</para></listitem></varlistentry>
135
136         </variablelist> 
137         </refsect2>
138         
139         <refsect2>
140         <title>LSARPC-DS</title>
141         
142         <variablelist>
143                 <varlistentry><term>dsroledominfo</term><listitem><para>Get Primary Domain Information</para></listitem></varlistentry>
144         </variablelist>
145
146         <para> </para>
147
148         <para><emphasis>DFS</emphasis></para>
149         <variablelist>
150                 <varlistentry><term>dfsexist</term><listitem><para>Query DFS support</para></listitem></varlistentry>
151                 <varlistentry><term>dfsadd</term><listitem><para>Add a DFS share</para></listitem></varlistentry>
152                 <varlistentry><term>dfsremove</term><listitem><para>Remove a DFS share</para></listitem></varlistentry>
153                 <varlistentry><term>dfsgetinfo</term><listitem><para>Query DFS share info</para></listitem></varlistentry>
154                 <varlistentry><term>dfsenum</term><listitem><para>Enumerate dfs shares</para></listitem></varlistentry>
155         </variablelist>
156
157         </refsect2>
158
159         <refsect2>
160         <title>REG</title>
161         <variablelist>
162                 <varlistentry><term>shutdown</term><listitem><para>Remote Shutdown</para></listitem></varlistentry>
163                 <varlistentry><term>abortshutdown</term><listitem><para>Abort Shutdown</para></listitem></varlistentry>
164         </variablelist>
165
166         </refsect2>
167
168         <refsect2>
169         <title>SRVSVC</title>
170
171         <variablelist>
172                 <varlistentry><term>srvinfo</term><listitem><para>Server query info</para></listitem></varlistentry>
173                 
174                 <varlistentry><term>netshareenum</term><listitem><para>Enumerate shares</para></listitem></varlistentry>
175
176                 <varlistentry><term>netfileenum</term><listitem><para>Enumerate open files</para></listitem></varlistentry>
177                 
178                 <varlistentry><term>netremotetod</term><listitem><para>Fetch remote time of day</para></listitem></varlistentry>
179                 
180         </variablelist>
181
182         </refsect2>
183
184         <refsect2>
185         <title>SAMR</title>
186
187         <variablelist>
188                 <varlistentry><term>queryuser</term><listitem><para>Query user info</para></listitem></varlistentry>
189                 <varlistentry><term>querygroup</term><listitem><para>Query group info</para></listitem></varlistentry>
190                 <varlistentry><term>queryusergroups</term><listitem><para>Query user groups</para></listitem></varlistentry>
191                 <varlistentry><term>querygroupmem</term><listitem><para>Query group membership</para></listitem></varlistentry>
192                 <varlistentry><term>queryaliasmem</term><listitem><para>Query alias membership</para></listitem></varlistentry>
193                 <varlistentry><term>querydispinfo</term><listitem><para>Query display info</para></listitem></varlistentry>
194                 <varlistentry><term>querydominfo</term><listitem><para>Query domain info</para></listitem></varlistentry>
195                 <varlistentry><term>enumdomusers</term><listitem><para>Enumerate domain users</para></listitem></varlistentry>
196                 <varlistentry><term>enumdomgroups</term><listitem><para>Enumerate domain groups</para></listitem></varlistentry>
197                 <varlistentry><term>enumalsgroups</term><listitem><para>Enumerate alias groups</para></listitem></varlistentry>
198                 <varlistentry><term>createdomuser</term><listitem><para>Create domain user</para></listitem></varlistentry>
199                 <varlistentry><term>samlookupnames</term><listitem><para>Look up names</para></listitem></varlistentry>
200                 <varlistentry><term>samlookuprids</term><listitem><para>Look up names</para></listitem></varlistentry>
201                 <varlistentry><term>deletedomuser</term><listitem><para>Delete domain user</para></listitem></varlistentry>
202                 <varlistentry><term>samquerysecobj</term><listitem><para>Query SAMR security object</para></listitem></varlistentry>
203                 <varlistentry><term>getdompwinfo</term><listitem><para>Retrieve domain password info</para></listitem></varlistentry>
204         </variablelist>
205
206         </refsect2>
207
208         <refsect2>
209         <title>SPOOLSS</title>
210
211         <variablelist>
212                 <varlistentry><term>adddriver &lt;arch&gt; &lt;config&gt;</term> 
213                 <listitem><para>
214                 Execute an AddPrinterDriver() RPC to install the printer driver 
215                 information on the server.  Note that the driver files should 
216                 already exist in the directory returned by  
217                 <command>getdriverdir</command>.  Possible values for 
218                 <parameter>arch</parameter> are the same as those for 
219                 the <command>getdriverdir</command> command.
220                 The <parameter>config</parameter> parameter is defined as 
221                 follows: </para>
222                 
223 <para><programlisting>
224 Long Printer Name:\
225 Driver File Name:\
226 Data File Name:\
227 Config File Name:\
228 Help File Name:\
229 Language Monitor Name:\
230 Default Data Type:\
231 Comma Separated list of Files
232 </programlisting></para>
233
234                 <para>Any empty fields should be enter as the string "NULL". </para>
235                 
236                 <para>Samba does not need to support the concept of Print Monitors
237                 since these only apply to local printers whose driver can make
238                 use of a bi-directional link for communication.  This field should 
239                 be "NULL".   On a remote NT print server, the Print Monitor for a 
240                 driver must already be installed prior to adding the driver or 
241                 else the RPC will fail. </para></listitem></varlistentry>
242         
243                 <varlistentry><term>addprinter &lt;printername&gt; 
244                 &lt;sharename&gt; &lt;drivername&gt; &lt;port&gt;</term>
245                 <listitem><para>
246                 Add a printer on the remote server.  This printer 
247                 will be automatically shared.  Be aware that the printer driver 
248                 must already be installed on the server (see <command>adddriver</command>) 
249                 and the <parameter>port</parameter>must be a valid port name (see
250                 <command>enumports</command>.</para>
251                 </listitem></varlistentry>
252
253
254                 <varlistentry><term>deldriver</term><listitem><para>Delete the 
255                 specified printer driver for all architectures.  This
256                 does not delete the actual driver files from the server,
257                 only the entry from the server's list of drivers.
258                 </para></listitem></varlistentry>
259
260                 <varlistentry><term>enumdata</term><listitem><para>Enumerate all 
261                 printer setting data stored on the server. On Windows NT  clients, 
262                 these values are stored  in the registry, while Samba servers 
263                 store them in the printers TDB.  This command corresponds
264                 to the MS Platform SDK GetPrinterData() function (* This
265                 command is currently unimplemented).</para></listitem></varlistentry>
266
267                 <varlistentry><term>enumdataex</term><listitem><para>Enumerate printer data for a key</para></listitem></varlistentry>
268
269                 <varlistentry><term>enumjobs &lt;printer&gt;</term>
270                 <listitem><para>List the jobs and status of a given printer. 
271                 This command corresponds to the MS Platform SDK EnumJobs() 
272                 function </listitem></varlistentry>
273
274                 <varlistentry><term>enumkey</term><listitem><para>Enumerate printer keys</para></listitem></varlistentry>
275                 
276                 <varlistentry><term>enumports [level]</term>
277                 <listitem><para>
278                 Executes an EnumPorts() call using the specified 
279                 info level. Currently only info levels 1 and 2 are supported. 
280                 </para></listitem></varlistentry>
281
282
283
284                 <varlistentry><term>enumdrivers [level]</term> 
285                 <listitem><para>
286                 Execute an EnumPrinterDrivers() call.  This lists the various installed 
287                 printer drivers for all architectures.  Refer to the MS Platform SDK 
288                 documentation for more details of the various flags and calling 
289                 options. Currently supported info levels are 1, 2, and 3.</para></listitem></varlistentry>
290
291
292
293                 <varlistentry><term>enumprinters [level]</term>
294                 <listitem><para>Execute an EnumPrinters() call.  This lists the various installed 
295                 and share printers.  Refer to the MS Platform SDK documentation for 
296                 more details of the various flags and calling options. Currently
297                 supported info levels are 0, 1, and 2.</para></listitem></varlistentry>
298
299
300
301
302                 <varlistentry><term>getdata &lt;printername&gt; &lt;valuename;&gt;</term> 
303                 <listitem><para>Retrieve the data for a given printer setting.  See 
304                 the  <command>enumdata</command> command for more information.  
305                 This command corresponds to the GetPrinterData() MS Platform 
306                 SDK function. </para></listitem></varlistentry>
307
308                 <varlistentry><term>getdataex</term><listitem><para>Get printer driver data with keyname</para></listitem></varlistentry>
309
310                 
311                 <varlistentry><term>getdriver &lt;printername&gt;</term>
312                 <listitem><para>
313                 Retrieve the printer driver information (such as driver file, 
314                 config file, dependent files, etc...) for 
315                 the given printer. This command corresponds to the GetPrinterDriver()
316                 MS Platform  SDK function. Currently info level 1, 2, and 3 are supported.
317                 </para></listitem></varlistentry>
318         
319
320                 <varlistentry><term>getdriverdir &lt;arch&gt;</term>
321                 <listitem><para>
322                 Execute a GetPrinterDriverDirectory()
323                 RPC to retrieve 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></varlistentry>
328
329
330
331                 <varlistentry><term>getprinter &lt;printername&gt;</term> 
332                 <listitem><para>Retrieve the current printer information.  This command 
333                 corresponds to the GetPrinter() MS Platform SDK function. 
334                 </para></listitem></varlistentry>
335
336                 <varlistentry><term>getprintprocdir</term><listitem><para>Get print processor directory</para></listitem></varlistentry>
337                 
338                 <varlistentry><term>openprinter &lt;printername&gt;</term> 
339                 <listitem><para>Execute an OpenPrinterEx() and ClosePrinter() RPC 
340                 against a given printer. </para></listitem> 
341
342                 <varlistentry><term>setdriver &lt;printername&gt;
343                 &lt;drivername&gt;</term>
344                 <listitem><para>Execute a SetPrinter() command to update the printer driver
345                 associated with an installed printer.  The printer driver must
346                 already be correctly 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></varlistentry>
351
352                 <varlistentry><term>addform</term><listitem><para>Add form</para></listitem></varlistentry>
353                 <varlistentry><term>setform</term><listitem><para>Set form</para></listitem></varlistentry>
354                 <varlistentry><term>getform</term><listitem><para>Get form</para></listitem></varlistentry>
355                 <varlistentry><term>deleteform</term><listitem><para>Delete form</para></listitem></varlistentry>
356                 <varlistentry><term>enumforms</term><listitem><para>Enumerate form</para></listitem></varlistentry>
357                 <varlistentry><term>setprinter</term><listitem><para>Set printer comment</para></listitem></varlistentry>
358                 <varlistentry><term>setprinterdata</term><listitem><para>Set REG_SZ printer data</para></listitem></varlistentry>
359                 <varlistentry><term>rffpcnex</term><listitem><para>Rffpcnex test</para></listitem></varlistentry>
360                 
361
362         </variablelist>
363
364         </refsect2>
365
366         <refsect2>
367         <title>NETLOGON</title>
368
369         <variablelist>
370
371         <varlistentry><term>logonctrl2</term>
372         <listitem><para>Logon Control 2</para></listitem>
373         </varlistentry>
374
375         <varlistentry><term>logonctrl</term>
376         <listitem><para>Logon Control</para></listitem>
377         </varlistentry>
378
379         <varlistentry><term>samsync</term>
380         <listitem><para>Sam Synchronisation</para></listitem>
381         </varlistentry>
382
383         <varlistentry><term>samdeltas</term>
384         <listitem><para>Query Sam Deltas</para></listitem>
385         </varlistentry>
386
387         <varlistentry><term>samlogon</term>
388         <listitem><para>Sam Logon</para></listitem>
389         </varlistentry>
390
391         </variablelist>
392         </refsect2>
393
394         <refsect2>
395         <title>GENERAL COMMANDS</title>
396
397         <variablelist>
398                 <varlistentry><term>debuglevel</term><listitem><para>Set the current
399                 debug level used to log information.</para></listitem></varlistentry>
400
401                 <varlistentry><term>help (?)</term><listitem><para>Print a listing of all 
402                 known commands or extended help  on a particular command. 
403                 </para></listitem></varlistentry>
404                 
405                 <varlistentry><term>quit (exit)</term><listitem><para>Exit <command>rpcclient
406                 </command>.</para></listitem></varlistentry>
407         </variablelist>
408         </refsect2>
409
410 </refsect1>
411
412 <refsect1>
413         <title>BUGS</title>
414         
415         <para><command>rpcclient</command> is designed as a developer testing tool 
416         and may not be robust in certain areas (such as command line parsing).  
417         It has been known to  generate a core dump upon failures when invalid 
418         parameters where passed to the interpreter. </para>
419
420         <para>From Luke Leighton's original rpcclient man page:</para>
421         
422         <para><emphasis>WARNING!</emphasis> The MSRPC over SMB code has 
423         been developed from examining  Network traces. No documentation is 
424         available from the original creators  (Microsoft) on how MSRPC over 
425         SMB works, or how the individual MSRPC services  work. Microsoft's 
426         implementation of these services has been demonstrated  (and reported) 
427         to be... a bit flaky in places. </para>
428
429         <para>The development of Samba's implementation is also a bit rough, 
430         and as more of the services are understood, it can even result in 
431         versions of <citerefentry><refentrytitle>smbd</refentrytitle>
432         <manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>rpcclient</refentrytitle>
433         <manvolnum>1</manvolnum></citerefentry> that are incompatible for some commands or  services. Additionally, 
434         the developers are sending reports to Microsoft,  and problems found 
435         or reported to Microsoft are fixed in Service Packs,  which may 
436         result in incompatibilities.</para>
437 </refsect1>
438
439
440 <refsect1>
441         <title>VERSION</title>
442
443         <para>This man page is correct for version 3.0 of the Samba 
444         suite.</para>
445 </refsect1>
446
447 <refsect1>
448         <title>AUTHOR</title>
449         
450         <para>The original Samba software and related utilities 
451         were created by Andrew Tridgell. Samba is now developed
452         by the Samba Team as an Open Source project similar 
453         to the way the Linux kernel is developed.</para>
454         
455         <para>The original rpcclient man page was written by Matthew 
456         Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter.  
457         The conversion to DocBook for Samba 2.2 was done by Gerald 
458         Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was
459         done by Alexander Bokovoy.</para>
460 </refsect1>
461
462 </refentry>