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