76bcbc25528d12afb60390f6343e984ba1b09067
[bbaumbach/samba-autobuild/.git] / docs-xml / manpages / rpcclient.1.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="rpcclient.1">
4
5 <refmeta>
6         <refentrytitle>rpcclient</refentrytitle>
7         <manvolnum>1</manvolnum>
8         <refmiscinfo class="source">Samba</refmiscinfo>
9         <refmiscinfo class="manual">User Commands</refmiscinfo>
10         <refmiscinfo class="version">4.1</refmiscinfo>
11 </refmeta>
12
13
14 <refnamediv>
15         <refname>rpcclient</refname>
16         <refpurpose>tool for executing client side 
17         MS-RPC functions</refpurpose>
18 </refnamediv>
19
20 <refsynopsisdiv>
21         <cmdsynopsis>
22                 <command>rpcclient</command>
23                 <arg choice="opt">-A authfile</arg>
24                 <arg choice="opt">-c &lt;command string&gt;</arg>
25                 <arg choice="opt">-d debuglevel</arg>
26                 <arg choice="opt">-l logdir</arg>
27                 <arg choice="opt">-N</arg>
28                 <arg choice="opt">-s &lt;smb config file&gt;</arg>
29                 <arg choice="opt">-U username[%password]</arg>
30                 <arg choice="opt">-W workgroup</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 <smbconfoption name="name resolve order"/> line from <citerefentry><refentrytitle>smb.conf</refentrytitle>
59         <manvolnum>5</manvolnum></citerefentry>.</para></listitem>
60         </varlistentry>
61
62
63                 <varlistentry>
64                 <term>-c|--command=&lt;command string&gt;</term>
65                 <listitem><para>Execute semicolon separated commands (listed
66                 below) </para></listitem>
67                 </varlistentry>
68
69                 
70                 <varlistentry>
71                 <term>-I|--dest-ip IP-address</term>
72                 <listitem><para><replaceable>IP address</replaceable> is the address of the server to connect to. 
73                 It should be specified in standard "a.b.c.d" notation. </para>
74
75                 <para>Normally the client would attempt to locate a named 
76                 SMB/CIFS server by looking it up via the NetBIOS name resolution 
77                 mechanism described above in the <parameter>name resolve order</parameter> 
78                 parameter above. Using this parameter will force the client
79                 to assume that the server is on the machine with the specified IP 
80                 address and the NetBIOS name component of the resource being 
81                 connected to will be ignored. </para>
82
83                 <para>There is no default for this parameter. If not supplied, 
84                 it will be determined automatically by the client as described 
85                 above. </para></listitem>
86                 </varlistentry>
87
88                 <varlistentry>
89                 <term>-p|--port port</term>
90                 <listitem><para>This number is the TCP port number that will be used
91                 when making connections to the server. The standard (well-known)
92                 TCP port number for an SMB/CIFS server is 139, which is the
93                 default. </para></listitem>
94                 </varlistentry>
95
96                 &stdarg.server.debug;
97                 &popt.common.samba;
98                 &popt.common.credentials;               
99                 &popt.common.connection;
100                 &popt.autohelp;
101         </variablelist>
102 </refsect1>
103
104
105 <refsect1>
106         <title>COMMANDS</title>
107
108         <refsect2>
109         <title>LSARPC</title>
110
111         <variablelist>
112                 <varlistentry><term>lsaquery</term><listitem><para>Query info policy</para></listitem></varlistentry>
113                 
114                 <varlistentry><term>lookupsids</term><listitem><para>Resolve a list 
115                 of SIDs to usernames.
116                 </para></listitem></varlistentry>
117                 
118                 <varlistentry><term>lookupnames</term><listitem><para>Resolve a list 
119                 of usernames to SIDs.
120                 </para></listitem></varlistentry>
121                 
122                 <varlistentry><term>enumtrust</term><listitem><para>Enumerate trusted domains</para></listitem></varlistentry>
123
124                 <varlistentry><term>enumprivs</term><listitem><para>Enumerate privileges</para></listitem></varlistentry>
125
126                 <varlistentry><term>getdispname</term><listitem><para>Get the privilege name</para></listitem></varlistentry>
127
128                 <varlistentry><term>lsaenumsid</term><listitem><para>Enumerate the LSA SIDS</para></listitem></varlistentry>
129
130                 <varlistentry><term>lsaenumprivsaccount</term><listitem><para>Enumerate the privileges of an SID</para></listitem></varlistentry>
131
132                 <varlistentry><term>lsaenumacctrights</term><listitem><para>Enumerate the rights of an SID</para></listitem></varlistentry>
133
134                 <varlistentry><term>lsaenumacctwithright</term><listitem><para>Enumerate accounts with a right</para></listitem></varlistentry>
135
136                 <varlistentry><term>lsaaddacctrights</term><listitem><para>Add rights to an account</para></listitem></varlistentry>
137
138                 <varlistentry><term>lsaremoveacctrights</term><listitem><para>Remove rights from an account</para></listitem></varlistentry>
139
140                 <varlistentry><term>lsalookupprivvalue</term><listitem><para>Get a privilege value given its name</para></listitem></varlistentry>
141
142                 <varlistentry><term>lsaquerysecobj</term><listitem><para>Query LSA security object</para></listitem></varlistentry>
143
144         </variablelist> 
145         </refsect2>
146         
147         <refsect2>
148         <title>LSARPC-DS</title>
149         
150         <variablelist>
151                 <varlistentry><term>dsroledominfo</term><listitem><para>Get Primary Domain Information</para></listitem></varlistentry>
152         </variablelist>
153
154         <para> </para>
155
156         <para><emphasis>DFS</emphasis></para>
157         <variablelist>
158                 <varlistentry><term>dfsexist</term><listitem><para>Query DFS support</para></listitem></varlistentry>
159                 <varlistentry><term>dfsadd</term><listitem><para>Add a DFS share</para></listitem></varlistentry>
160                 <varlistentry><term>dfsremove</term><listitem><para>Remove a DFS share</para></listitem></varlistentry>
161                 <varlistentry><term>dfsgetinfo</term><listitem><para>Query DFS share info</para></listitem></varlistentry>
162                 <varlistentry><term>dfsenum</term><listitem><para>Enumerate dfs shares</para></listitem></varlistentry>
163         </variablelist>
164
165         </refsect2>
166
167         <refsect2>
168         <title>REG</title>
169         <variablelist>
170                 <varlistentry><term>shutdown</term><listitem><para>Remote Shutdown</para></listitem></varlistentry>
171                 <varlistentry><term>abortshutdown</term><listitem><para>Abort Shutdown</para></listitem></varlistentry>
172         </variablelist>
173
174         </refsect2>
175
176         <refsect2>
177         <title>SRVSVC</title>
178
179         <variablelist>
180                 <varlistentry><term>srvinfo</term><listitem><para>Server query info</para></listitem></varlistentry>
181                 
182                 <varlistentry><term>netshareenum</term><listitem><para>Enumerate shares</para></listitem></varlistentry>
183
184                 <varlistentry><term>netfileenum</term><listitem><para>Enumerate open files</para></listitem></varlistentry>
185                 
186                 <varlistentry><term>netremotetod</term><listitem><para>Fetch remote time of day</para></listitem></varlistentry>
187                 
188         </variablelist>
189
190         </refsect2>
191
192         <refsect2>
193         <title>SAMR</title>
194
195         <variablelist>
196                 <varlistentry><term>queryuser</term><listitem><para>Query user info</para></listitem></varlistentry>
197                 <varlistentry><term>querygroup</term><listitem><para>Query group info</para></listitem></varlistentry>
198                 <varlistentry><term>queryusergroups</term><listitem><para>Query user groups</para></listitem></varlistentry>
199                 <varlistentry><term>querygroupmem</term><listitem><para>Query group membership</para></listitem></varlistentry>
200                 <varlistentry><term>queryaliasmem</term><listitem><para>Query alias membership</para></listitem></varlistentry>
201                 <varlistentry><term>querydispinfo</term><listitem><para>Query display info</para></listitem></varlistentry>
202                 <varlistentry><term>querydominfo</term><listitem><para>Query domain info</para></listitem></varlistentry>
203                 <varlistentry><term>enumdomusers</term><listitem><para>Enumerate domain users</para></listitem></varlistentry>
204                 <varlistentry><term>enumdomgroups</term><listitem><para>Enumerate domain groups</para></listitem></varlistentry>
205                 <varlistentry><term>enumalsgroups</term><listitem><para>Enumerate alias groups</para></listitem></varlistentry>
206                 <varlistentry><term>createdomuser</term><listitem><para>Create domain user</para></listitem></varlistentry>
207                 <varlistentry><term>samlookupnames</term><listitem><para>Look up names</para></listitem></varlistentry>
208                 <varlistentry><term>samlookuprids</term><listitem><para>Look up names</para></listitem></varlistentry>
209                 <varlistentry><term>deletedomuser</term><listitem><para>Delete domain user</para></listitem></varlistentry>
210                 <varlistentry><term>samquerysecobj</term><listitem><para>Query SAMR security object</para></listitem></varlistentry>
211                 <varlistentry><term>getdompwinfo</term><listitem><para>Retrieve domain password info</para></listitem></varlistentry>
212                 <varlistentry><term>lookupdomain</term><listitem><para>Look up domain</para></listitem></varlistentry>
213         </variablelist>
214
215         </refsect2>
216
217         <refsect2>
218         <title>SPOOLSS</title>
219
220         <variablelist>
221                 <varlistentry><term>adddriver &lt;arch&gt; &lt;config&gt; [&lt;version&gt;]</term> 
222                 <listitem><para>
223                 Execute an AddPrinterDriver() RPC to install the printer driver 
224                 information on the server.  Note that the driver files should 
225                 already exist in the directory returned by  
226                 <command>getdriverdir</command>.  Possible values for 
227                 <parameter>arch</parameter> are the same as those for 
228                 the <command>getdriverdir</command> command.
229                 The <parameter>config</parameter> parameter is defined as 
230                 follows: </para>
231                 
232 <para><programlisting>
233 Long Driver Name:\
234 Driver File Name:\
235 Data File Name:\
236 Config File Name:\
237 Help File Name:\
238 Language Monitor Name:\
239 Default Data Type:\
240 Comma Separated list of Files
241 </programlisting></para>
242
243                 <para>Any empty fields should be enter as the string "NULL". </para>
244                 
245                 <para>Samba does not need to support the concept of Print Monitors
246                 since these only apply to local printers whose driver can make
247                 use of a bi-directional link for communication.  This field should 
248                 be "NULL".   On a remote NT print server, the Print Monitor for a 
249                 driver must already be installed prior to adding the driver or 
250                 else the RPC will fail. </para>
251
252                 <para>The <parameter>version</parameter> parameter lets you
253                 specify the printer driver version number.  If omitted, the
254                 default driver version for the specified architecture will
255                 be used.  This option can be used to upload Windows 2000
256                 (version 3) printer drivers.</para></listitem></varlistentry>
257         
258                 <varlistentry><term>addprinter &lt;printername&gt; 
259                 &lt;sharename&gt; &lt;drivername&gt; &lt;port&gt;</term>
260                 <listitem><para>
261                 Add a printer on the remote server.  This printer 
262                 will be automatically shared.  Be aware that the printer driver 
263                 must already be installed on the server (see <command>adddriver</command>) 
264                 and the <parameter>port</parameter>must be a valid port name (see
265                 <command>enumports</command>.</para>
266                 </listitem></varlistentry>
267
268
269                 <varlistentry><term>deldriver &lt;driver&gt;</term><listitem><para>Delete the
270                 specified printer driver for all architectures.  This
271                 does not delete the actual driver files from the server,
272                 only the entry from the server's list of drivers.
273                 </para></listitem></varlistentry>
274
275                 <varlistentry><term>deldriverex &lt;driver&gt; [architecture] [version] [flags]
276                 </term><listitem><para>Delete the specified printer driver and optionally files
277                 associated with the driver.
278                 You can limit this action to a specific architecture and a specific version.
279                 If no architecture is given, all driver files of that driver will be deleted.
280                 <parameter>flags</parameter> correspond to numeric DPD_* values, i.e. a value
281                 of 3 requests (DPD_DELETE_UNUSED_FILES | DPD_DELETE_SPECIFIC_VERSION).
282                 </para></listitem></varlistentry>
283
284                 <varlistentry><term>enumdata</term><listitem><para>Enumerate all 
285                 printer setting data stored on the server. On Windows NT  clients, 
286                 these values are stored  in the registry, while Samba servers 
287                 store them in the printers TDB.  This command corresponds
288                 to the MS Platform SDK GetPrinterData() function (* This
289                 command is currently unimplemented).</para></listitem></varlistentry>
290
291                 <varlistentry><term>enumdataex</term><listitem><para>Enumerate printer data for a key</para></listitem></varlistentry>
292
293                 <varlistentry><term>enumjobs &lt;printer&gt;</term>
294                 <listitem><para>List the jobs and status of a given printer. 
295                 This command corresponds to the MS Platform SDK EnumJobs() 
296                 function</para></listitem></varlistentry>
297
298                 <varlistentry><term>enumkey</term><listitem><para>Enumerate
299                 printer keys</para></listitem></varlistentry>
300                 
301                 <varlistentry><term>enumports [level]</term>
302                 <listitem><para>
303                 Executes an EnumPorts() call using the specified 
304                 info level. Currently only info levels 1 and 2 are supported. 
305                 </para></listitem></varlistentry>
306
307
308
309                 <varlistentry><term>enumdrivers [level]</term> 
310                 <listitem><para>
311                 Execute an EnumPrinterDrivers() call.  This lists the various installed 
312                 printer drivers for all architectures.  Refer to the MS Platform SDK 
313                 documentation for more details of the various flags and calling 
314                 options. Currently supported info levels are 1, 2, and 3.</para></listitem></varlistentry>
315
316
317
318                 <varlistentry><term>enumprinters [level]</term>
319                 <listitem><para>Execute an EnumPrinters() call.  This lists the various installed 
320                 and share printers.  Refer to the MS Platform SDK documentation for 
321                 more details of the various flags and calling options. Currently
322                 supported info levels are 1, 2 and 5.</para></listitem></varlistentry>
323
324
325
326
327                 <varlistentry><term>getdata &lt;printername&gt; &lt;valuename;&gt;</term> 
328                 <listitem><para>Retrieve the data for a given printer setting.  See 
329                 the  <command>enumdata</command> command for more information.  
330                 This command corresponds to the GetPrinterData() MS Platform 
331                 SDK function. </para></listitem></varlistentry>
332
333                 <varlistentry><term>getdataex</term><listitem><para>Get
334                 printer driver data with
335                 keyname</para></listitem></varlistentry>
336
337                 
338                 <varlistentry><term>getdriver &lt;printername&gt;</term>
339                 <listitem><para>
340                 Retrieve the printer driver information (such as driver file, 
341                 config file, dependent files, etc...) for 
342                 the given printer. This command corresponds to the GetPrinterDriver()
343                 MS Platform  SDK function. Currently info level 1, 2, and 3 are supported.
344                 </para></listitem></varlistentry>
345         
346
347                 <varlistentry><term>getdriverdir &lt;arch&gt;</term>
348                 <listitem><para>
349                 Execute a GetPrinterDriverDirectory()
350                 RPC to retrieve the SMB share name and subdirectory for 
351                 storing printer driver files for a given architecture.  Possible 
352                 values for <parameter>arch</parameter> are "Windows 4.0" 
353                 (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
354                 Alpha_AXP", and "Windows NT R4000". </para></listitem></varlistentry>
355
356
357
358                 <varlistentry><term>getprinter &lt;printername&gt;</term> 
359                 <listitem><para>Retrieve the current printer information.  This command 
360                 corresponds to the GetPrinter() MS Platform SDK function. 
361                 </para></listitem></varlistentry>
362
363                 <varlistentry><term>getprintprocdir</term><listitem><para>Get
364                 print processor
365                 directory</para></listitem></varlistentry>
366                 
367                 <varlistentry><term>openprinter &lt;printername&gt;</term> 
368                 <listitem><para>Execute an OpenPrinterEx() and ClosePrinter() RPC 
369                 against a given printer. </para></listitem></varlistentry>
370
371                 <varlistentry><term>setdriver &lt;printername&gt;
372                 &lt;drivername&gt;</term>
373                 <listitem><para>Execute a SetPrinter() command to update the printer driver
374                 associated with an installed printer.  The printer driver must
375                 already be correctly installed on the print server.  </para>
376
377                 <para>See also the <command>enumprinters</command> and 
378                 <command>enumdrivers</command> commands for obtaining a list of
379                 of installed printers and drivers.</para></listitem></varlistentry>
380
381                 <varlistentry><term>addform</term><listitem><para>Add form</para></listitem></varlistentry>
382                 <varlistentry><term>setform</term><listitem><para>Set form</para></listitem></varlistentry>
383                 <varlistentry><term>getform</term><listitem><para>Get form</para></listitem></varlistentry>
384                 <varlistentry><term>deleteform</term><listitem><para>Delete form</para></listitem></varlistentry>
385                 <varlistentry><term>enumforms</term><listitem><para>Enumerate form</para></listitem></varlistentry>
386                 <varlistentry><term>setprinter</term><listitem><para>Set printer comment</para></listitem></varlistentry>
387                 <varlistentry><term>setprinterdata</term><listitem><para>Set REG_SZ printer data</para></listitem></varlistentry>
388
389                 <varlistentry><term>setprintername &lt;printername&gt;
390                 &lt;newprintername&gt;</term>
391                 <listitem><para>Set printer name</para></listitem></varlistentry>
392
393                 <varlistentry><term>rffpcnex</term><listitem><para>Rffpcnex test</para></listitem></varlistentry>
394                 
395
396         </variablelist>
397
398         </refsect2>
399
400         <refsect2>
401         <title>NETLOGON</title>
402
403         <variablelist>
404
405         <varlistentry><term>logonctrl2</term>
406         <listitem><para>Logon Control 2</para></listitem>
407         </varlistentry>
408
409         <varlistentry><term>logonctrl</term>
410         <listitem><para>Logon Control</para></listitem>
411         </varlistentry>
412
413         <varlistentry><term>samsync</term>
414         <listitem><para>Sam Synchronisation</para></listitem>
415         </varlistentry>
416
417         <varlistentry><term>samdeltas</term>
418         <listitem><para>Query Sam Deltas</para></listitem>
419         </varlistentry>
420
421         <varlistentry><term>samlogon</term>
422         <listitem><para>Sam Logon</para></listitem>
423         </varlistentry>
424
425         </variablelist>
426         </refsect2>
427
428         <refsect2>
429         <title>FSRVP</title>
430         <variablelist>
431
432         <varlistentry><term>fss_is_path_sup &lt;share&gt;</term>
433                 <listitem>
434                         <para>Check whether a share supports shadow-copy
435                         requests</para>
436                 </listitem>
437         </varlistentry>
438         <varlistentry><term>fss_get_sup_version</term>
439                 <listitem>
440                         <para>Get supported FSRVP version from server</para>
441                 </listitem>
442         </varlistentry>
443         <varlistentry><term>fss_create_expose &lt;context&gt; &lt;[ro|rw]&gt;
444                                               &lt;share1&gt;
445                                               [share2] ... [shareN]</term>
446                 <listitem>
447                         <para>Request shadow-copy creation and exposure as a
448                         new share</para>
449                 </listitem>
450         </varlistentry>
451         <varlistentry><term>fss_delete &lt;base_share&gt;
452                                        &lt;shadow_copy_set_id&gt;
453                                        &lt;shadow_copy_id&gt;</term>
454                 <listitem>
455                         <para>Request shadow-copy share deletion</para>
456         </listitem>
457         </varlistentry>
458         <varlistentry><term>fss_has_shadow_copy &lt;base_share&gt;</term>
459                 <listitem>
460                         <para>Check for an associated share shadow-copy</para>
461                 </listitem>
462         </varlistentry>
463         <varlistentry><term>fss_get_mapping &lt;base_share&gt;
464                                             &lt;shadow_copy_set_id&gt;
465                                             &lt;shadow_copy_id&gt;</term>
466                 <listitem>
467                         <para>Get shadow-copy share mapping information</para>
468                 </listitem>
469         </varlistentry>
470         <varlistentry><term>fss_recovery_complete &lt;shadow_copy_set_id&gt;</term>
471                 <listitem>
472                         <para>Flag read-write shadow-copy as recovery complete,
473                         allowing further shadow-copy requests</para>
474                 </listitem>
475         </varlistentry>
476
477         </variablelist>
478         </refsect2>
479
480         <refsect2>
481         <title>GENERAL COMMANDS</title>
482
483         <variablelist>
484                 <varlistentry><term>debuglevel</term><listitem><para>Set the current
485                 debug level used to log information.</para></listitem></varlistentry>
486
487                 <varlistentry><term>help (?)</term><listitem><para>Print a listing of all 
488                 known commands or extended help  on a particular command. 
489                 </para></listitem></varlistentry>
490                 
491                 <varlistentry><term>quit (exit)</term><listitem><para>Exit <command>rpcclient
492                 </command>.</para></listitem></varlistentry>
493         </variablelist>
494         </refsect2>
495
496 </refsect1>
497
498 <refsect1>
499         <title>BUGS</title>
500         
501         <para><command>rpcclient</command> is designed as a developer testing tool 
502         and may not be robust in certain areas (such as command line parsing).  
503         It has been known to  generate a core dump upon failures when invalid 
504         parameters where passed to the interpreter. </para>
505
506         <para>From Luke Leighton's original rpcclient man page:</para>
507         
508         <para><emphasis>WARNING!</emphasis> The MSRPC over SMB code has 
509         been developed from examining  Network traces. No documentation is 
510         available from the original creators  (Microsoft) on how MSRPC over 
511         SMB works, or how the individual MSRPC services  work. Microsoft's 
512         implementation of these services has been demonstrated  (and reported) 
513         to be... a bit flaky in places. </para>
514
515         <para>The development of Samba's implementation is also a bit rough, 
516         and as more of the services are understood, it can even result in 
517         versions of <citerefentry><refentrytitle>smbd</refentrytitle>
518         <manvolnum>8</manvolnum></citerefentry> and <citerefentry><refentrytitle>rpcclient</refentrytitle>
519         <manvolnum>1</manvolnum></citerefentry> that are incompatible for some commands or  services. Additionally, 
520         the developers are sending reports to Microsoft,  and problems found 
521         or reported to Microsoft are fixed in Service Packs,  which may 
522         result in incompatibilities.</para>
523 </refsect1>
524
525
526 <refsect1>
527         <title>VERSION</title>
528
529         <para>This man page is correct for version 3 of the Samba 
530         suite.</para>
531 </refsect1>
532
533 <refsect1>
534         <title>AUTHOR</title>
535         
536         <para>The original Samba software and related utilities 
537         were created by Andrew Tridgell. Samba is now developed
538         by the Samba Team as an Open Source project similar 
539         to the way the Linux kernel is developed.</para>
540         
541         <para>The original rpcclient man page was written by Matthew 
542         Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter.  
543         The conversion to DocBook for Samba 2.2 was done by Gerald 
544         Carter. The conversion to DocBook XML 4.2 for Samba 3.0 was
545         done by Alexander Bokovoy.</para>
546 </refsect1>
547
548 </refentry>