This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[ira/wip.git] / docs / htmldocs / rpcclient.1.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >rpcclient</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.77"></HEAD
9 ><BODY
10 CLASS="REFENTRY"
11 BGCOLOR="#FFFFFF"
12 TEXT="#000000"
13 LINK="#0000FF"
14 VLINK="#840084"
15 ALINK="#0000FF"
16 ><H1
17 ><A
18 NAME="RPCCLIENT"
19 ></A
20 >rpcclient</H1
21 ><DIV
22 CLASS="REFNAMEDIV"
23 ><A
24 NAME="AEN5"
25 ></A
26 ><H2
27 >Name</H2
28 >rpcclient&nbsp;--&nbsp;tool for executing client side 
29         MS-RPC functions</DIV
30 ><DIV
31 CLASS="REFSYNOPSISDIV"
32 ><A
33 NAME="AEN8"
34 ></A
35 ><H2
36 >Synopsis</H2
37 ><P
38 ><B
39 CLASS="COMMAND"
40 >rpcclient</B
41 >  [-A authfile] [-c &lt;command string&gt;] [-d debuglevel] [-h] [-l logfile] [-N] [-s &lt;smb config file&gt;] [-U username[%password]] [-W workgroup] [-N] [-I destinationIP] {server}</P
42 ></DIV
43 ><DIV
44 CLASS="REFSECT1"
45 ><A
46 NAME="AEN23"
47 ></A
48 ><H2
49 >DESCRIPTION</H2
50 ><P
51 >This tool is part of the <A
52 HREF="samba.7.html"
53 TARGET="_top"
54 >       Samba</A
55 > suite.</P
56 ><P
57 ><B
58 CLASS="COMMAND"
59 >rpcclient</B
60 > is a utility initially developed
61         to test MS-RPC functionality in Samba itself.  It has undergone 
62         several stages of development and stability.  Many system administrators
63         have now written scripts around it to manage Windows NT clients from 
64         their UNIX workstation. </P
65 ></DIV
66 ><DIV
67 CLASS="REFSECT1"
68 ><A
69 NAME="AEN29"
70 ></A
71 ><H2
72 >OPTIONS</H2
73 ><P
74 ></P
75 ><DIV
76 CLASS="VARIABLELIST"
77 ><DL
78 ><DT
79 >server</DT
80 ><DD
81 ><P
82 >NetBIOS name of Server to which to connect. 
83                 The server can be  any SMB/CIFS server.  The name is 
84                 resolved using the <A
85 HREF="smb.conf.5.html#NAMERESOLVEORDER"
86 TARGET="_top"
87 >               <TT
88 CLASS="PARAMETER"
89 ><I
90 >name resolve order</I
91 ></TT
92 ></A
93 > line from 
94                 <TT
95 CLASS="FILENAME"
96 >smb.conf(5)</TT
97 >.</P
98 ></DD
99 ><DT
100 >-A|--authfile=filename</DT
101 ><DD
102 ><P
103 >This option allows 
104                 you to specify a file from which to read the username and 
105                 password used in the connection.  The format of the file is 
106                 </P
107 ><P
108 ><PRE
109 CLASS="PROGRAMLISTING"
110 >               username = &lt;value&gt; 
111                 password = &lt;value&gt;
112                 domain   = &lt;value&gt;
113                 </PRE
114 ></P
115 ><P
116 >Make certain that the permissions on the file restrict 
117                 access from unwanted users. </P
118 ></DD
119 ><DT
120 >-c|--command='command string'</DT
121 ><DD
122 ><P
123 >execute semicolon separated commands (listed 
124                 below)) </P
125 ></DD
126 ><DT
127 >-d|--debug=debuglevel</DT
128 ><DD
129 ><P
130 ><TT
131 CLASS="REPLACEABLE"
132 ><I
133 >debuglevel</I
134 ></TT
135 > is an integer 
136 from 0 to 10.  The default value if this parameter is 
137 not specified is zero.</P
138 ><P
139 >The higher this value, the more detail will be 
140 logged to the log files about the activities of the 
141 server. At level 0, only critical errors and serious 
142 warnings will be logged. Level 1 is a reasonable level for
143 day to day running - it generates a small amount of 
144 information about operations carried out.</P
145 ><P
146 >Levels above 1 will generate considerable 
147 amounts of log data, and should only be used when 
148 investigating a problem. Levels above 3 are designed for 
149 use only by developers and generate HUGE amounts of log
150 data, most of which is extremely cryptic.</P
151 ><P
152 >Note that specifying this parameter here will 
153 override the <A
154 HREF="smb.conf.5.html#loglevel"
155 TARGET="_top"
156 >log
157 level</A
158 > parameter in the <A
159 HREF="smb.conf.5.html"
160 TARGET="_top"
161 ><TT
162 CLASS="FILENAME"
163 >smb.conf(5)</TT
164 ></A
165 > file.</P
166 ></DD
167 ><DT
168 >-h|--help</DT
169 ><DD
170 ><P
171 >Print a summary of command line options.</P
172 ></DD
173 ><DT
174 >-I IP-address</DT
175 ><DD
176 ><P
177 ><TT
178 CLASS="REPLACEABLE"
179 ><I
180 >IP address</I
181 ></TT
182 > is the address of the server to connect to. 
183                 It should be specified in standard "a.b.c.d" notation. </P
184 ><P
185 >Normally the client would attempt to locate a named 
186                 SMB/CIFS server by looking it up via the NetBIOS name resolution 
187                 mechanism described above in the <TT
188 CLASS="PARAMETER"
189 ><I
190 >name resolve order</I
191 ></TT
192
193                 parameter above. Using this parameter will force the client
194                 to assume that the server is on the machine with the specified IP 
195                 address and the NetBIOS name component of the resource being 
196                 connected to will be ignored. </P
197 ><P
198 >There is no default for this parameter. If not supplied, 
199                 it will be determined automatically by the client as described 
200                 above. </P
201 ></DD
202 ><DT
203 >-l|--logfile=logbasename</DT
204 ><DD
205 ><P
206 >File name for log/debug files. The extension 
207                 <TT
208 CLASS="CONSTANT"
209 >'.client'</TT
210 > will be appended. The log file is
211                 never removed by the client.
212                 </P
213 ></DD
214 ><DT
215 >-N|--nopass</DT
216 ><DD
217 ><P
218 >instruct <B
219 CLASS="COMMAND"
220 >rpcclient</B
221 > not to ask 
222                 for a password.   By default, <B
223 CLASS="COMMAND"
224 >rpcclient</B
225 > will
226                 prompt for a password.  See also the <TT
227 CLASS="PARAMETER"
228 ><I
229 >-U</I
230 ></TT
231 >
232                 option.</P
233 ></DD
234 ><DT
235 >-s|--conf=smb.conf</DT
236 ><DD
237 ><P
238 >Specifies the location of the all-important 
239                 <TT
240 CLASS="FILENAME"
241 >smb.conf</TT
242 > file. </P
243 ></DD
244 ><DT
245 >-U|--user=username[%password]</DT
246 ><DD
247 ><P
248 >Sets the SMB username or username and password. </P
249 ><P
250 >If %password is not specified, the user will be prompted. The 
251                 client will first check the <TT
252 CLASS="ENVAR"
253 >USER</TT
254 > environment variable, then the 
255                 <TT
256 CLASS="ENVAR"
257 >LOGNAME</TT
258 > variable and if either exists, the 
259                 string is uppercased. If these environmental variables are not 
260                 found, the username <TT
261 CLASS="CONSTANT"
262 >GUEST</TT
263 > is used. </P
264 ><P
265 >A third option is to use a credentials file which 
266                 contains the plaintext of the username and password.  This 
267                 option is mainly provided for scripts where the admin does not 
268                 wish to pass the credentials on the command line or via environment 
269                 variables. If this method is used, make certain that the permissions 
270                 on the file restrict access from unwanted users.  See the 
271                 <TT
272 CLASS="PARAMETER"
273 ><I
274 >-A</I
275 ></TT
276 > for more details. </P
277 ><P
278 >Be cautious about including passwords in scripts. Also, on 
279                 many systems the command line of a running process may be seen 
280                 via the <B
281 CLASS="COMMAND"
282 >ps</B
283 > command.  To be safe always allow 
284                 <B
285 CLASS="COMMAND"
286 >rpcclient</B
287 > to prompt for a password and type 
288                 it in directly. </P
289 ></DD
290 ><DT
291 >-W|--workgroup=domain</DT
292 ><DD
293 ><P
294 >Set the SMB domain of the username.   This 
295                 overrides the default domain which is the domain defined in 
296                 smb.conf.  If the domain specified is the same as the server's NetBIOS name, 
297                 it causes the client to log on using the  server's local SAM (as 
298                 opposed to the Domain SAM). </P
299 ></DD
300 ></DL
301 ></DIV
302 ></DIV
303 ><DIV
304 CLASS="REFSECT1"
305 ><A
306 NAME="AEN107"
307 ></A
308 ><H2
309 >COMMANDS</H2
310 ><P
311 ><SPAN
312 CLASS="emphasis"
313 ><I
314 CLASS="EMPHASIS"
315 >LSARPC</I
316 ></SPAN
317 ></P
318 ><P
319 ></P
320 ><UL
321 ><LI
322 ><P
323 ><B
324 CLASS="COMMAND"
325 >lsaquery</B
326 ></P
327 ></LI
328 ><LI
329 ><P
330 ><B
331 CLASS="COMMAND"
332 >lookupsids</B
333 > - Resolve a list 
334                 of SIDs to usernames.
335                 </P
336 ></LI
337 ><LI
338 ><P
339 ><B
340 CLASS="COMMAND"
341 >lookupnames</B
342 > - Resolve a list 
343                 of usernames to SIDs.
344                 </P
345 ></LI
346 ><LI
347 ><P
348 ><B
349 CLASS="COMMAND"
350 >enumtrusts</B
351 ></P
352 ></LI
353 ></UL
354 ><P
355 > </P
356 ><P
357 ><SPAN
358 CLASS="emphasis"
359 ><I
360 CLASS="EMPHASIS"
361 >SAMR</I
362 ></SPAN
363 ></P
364 ><P
365 ></P
366 ><UL
367 ><LI
368 ><P
369 ><B
370 CLASS="COMMAND"
371 >queryuser</B
372 ></P
373 ></LI
374 ><LI
375 ><P
376 ><B
377 CLASS="COMMAND"
378 >querygroup</B
379 ></P
380 ></LI
381 ><LI
382 ><P
383 ><B
384 CLASS="COMMAND"
385 >queryusergroups</B
386 ></P
387 ></LI
388 ><LI
389 ><P
390 ><B
391 CLASS="COMMAND"
392 >querygroupmem</B
393 ></P
394 ></LI
395 ><LI
396 ><P
397 ><B
398 CLASS="COMMAND"
399 >queryaliasmem</B
400 ></P
401 ></LI
402 ><LI
403 ><P
404 ><B
405 CLASS="COMMAND"
406 >querydispinfo</B
407 ></P
408 ></LI
409 ><LI
410 ><P
411 ><B
412 CLASS="COMMAND"
413 >querydominfo</B
414 ></P
415 ></LI
416 ><LI
417 ><P
418 ><B
419 CLASS="COMMAND"
420 >enumdomgroups</B
421 ></P
422 ></LI
423 ></UL
424 ><P
425 > </P
426 ><P
427 ><SPAN
428 CLASS="emphasis"
429 ><I
430 CLASS="EMPHASIS"
431 >SPOOLSS</I
432 ></SPAN
433 ></P
434 ><P
435 ></P
436 ><UL
437 ><LI
438 ><P
439 ><B
440 CLASS="COMMAND"
441 >adddriver &lt;arch&gt; &lt;config&gt;</B
442
443                 - Execute an AddPrinterDriver() RPC to install the printer driver 
444                 information on the server.  Note that the driver files should 
445                 already exist in the directory returned by  
446                 <B
447 CLASS="COMMAND"
448 >getdriverdir</B
449 >.  Possible values for 
450                 <TT
451 CLASS="PARAMETER"
452 ><I
453 >arch</I
454 ></TT
455 > are the same as those for 
456                 the <B
457 CLASS="COMMAND"
458 >getdriverdir</B
459 > command.
460                 The <TT
461 CLASS="PARAMETER"
462 ><I
463 >config</I
464 ></TT
465 > parameter is defined as 
466                 follows: </P
467 ><P
468 ><PRE
469 CLASS="PROGRAMLISTING"
470 >               Long Printer Name:\
471                 Driver File Name:\
472                 Data File Name:\
473                 Config File Name:\
474                 Help File Name:\
475                 Language Monitor Name:\
476                 Default Data Type:\
477                 Comma Separated list of Files
478                 </PRE
479 ></P
480 ><P
481 >Any empty fields should be enter as the string "NULL". </P
482 ><P
483 >Samba does not need to support the concept of Print Monitors
484                 since these only apply to local printers whose driver can make
485                 use of a bi-directional link for communication.  This field should 
486                 be "NULL".   On a remote NT print server, the Print Monitor for a 
487                 driver must already be installed prior to adding the driver or 
488                 else the RPC will fail. </P
489 ></LI
490 ><LI
491 ><P
492 ><B
493 CLASS="COMMAND"
494 >addprinter &lt;printername&gt; 
495                 &lt;sharename&gt; &lt;drivername&gt; &lt;port&gt;</B
496
497                 - Add a printer on the remote server.  This printer 
498                 will be automatically shared.  Be aware that the printer driver 
499                 must already be installed on the server (see <B
500 CLASS="COMMAND"
501 >adddriver</B
502 >) 
503                 and the <TT
504 CLASS="PARAMETER"
505 ><I
506 >port</I
507 ></TT
508 >must be a valid port name (see
509                 <B
510 CLASS="COMMAND"
511 >enumports</B
512 >.</P
513 ></LI
514 ><LI
515 ><P
516 ><B
517 CLASS="COMMAND"
518 >deldriver</B
519 > - Delete the 
520                 specified printer driver for all architectures.  This
521                 does not delete the actual driver files from the server,
522                 only the entry from the server's list of drivers.
523                 </P
524 ></LI
525 ><LI
526 ><P
527 ><B
528 CLASS="COMMAND"
529 >enumdata</B
530 > - Enumerate all 
531                 printer setting data stored on the server. On Windows NT  clients, 
532                 these values are stored  in the registry, while Samba servers 
533                 store them in the printers TDB.  This command corresponds
534                 to the MS Platform SDK GetPrinterData() function (* This
535                 command is currently unimplemented).</P
536 ></LI
537 ><LI
538 ><P
539 ><B
540 CLASS="COMMAND"
541 >enumjobs &lt;printer&gt;</B
542
543                 - List the jobs and status of a given printer. 
544                 This command corresponds to the MS Platform SDK EnumJobs() 
545                 function (* This command is currently unimplemented).</P
546 ></LI
547 ><LI
548 ><P
549 ><B
550 CLASS="COMMAND"
551 >enumports [level]</B
552
553                 - Executes an EnumPorts() call using the specified 
554                 info level. Currently only info levels 1 and 2 are supported. 
555                 </P
556 ></LI
557 ><LI
558 ><P
559 ><B
560 CLASS="COMMAND"
561 >enumdrivers [level]</B
562
563                 - Execute an EnumPrinterDrivers() call.  This lists the various installed 
564                 printer drivers for all architectures.  Refer to the MS Platform SDK 
565                 documentation for more details of the various flags and calling 
566                 options. Currently supported info levels are 1, 2, and 3.</P
567 ></LI
568 ><LI
569 ><P
570 ><B
571 CLASS="COMMAND"
572 >enumprinters [level]</B
573
574                 - Execute an EnumPrinters() call.  This lists the various installed 
575                 and share printers.  Refer to the MS Platform SDK documentation for 
576                 more details of the various flags and calling options. Currently
577                 supported info levels are 0, 1, and 2.</P
578 ></LI
579 ><LI
580 ><P
581 ><B
582 CLASS="COMMAND"
583 >getdata &lt;printername&gt;</B
584
585                 - Retrieve the data for a given printer setting.  See 
586                 the  <B
587 CLASS="COMMAND"
588 >enumdata</B
589 > command for more information.  
590                 This command corresponds to the GetPrinterData() MS Platform 
591                 SDK function (* This command is currently unimplemented). </P
592 ></LI
593 ><LI
594 ><P
595 ><B
596 CLASS="COMMAND"
597 >getdriver &lt;printername&gt;</B
598
599                 - Retrieve the printer driver information (such as driver file, 
600                 config file, dependent files, etc...) for 
601                 the given printer. This command corresponds to the GetPrinterDriver()
602                 MS Platform  SDK function. Currently info level 1, 2, and 3 are supported.
603                 </P
604 ></LI
605 ><LI
606 ><P
607 ><B
608 CLASS="COMMAND"
609 >getdriverdir &lt;arch&gt;</B
610
611                 - Execute a GetPrinterDriverDirectory()
612                 RPC to retrieve the SMB share name and subdirectory for 
613                 storing printer driver files for a given architecture.  Possible 
614                 values for <TT
615 CLASS="PARAMETER"
616 ><I
617 >arch</I
618 ></TT
619 > are "Windows 4.0" 
620                 (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
621                 Alpha_AXP", and "Windows NT R4000". </P
622 ></LI
623 ><LI
624 ><P
625 ><B
626 CLASS="COMMAND"
627 >getprinter &lt;printername&gt;</B
628
629                 - Retrieve the current printer information.  This command 
630                 corresponds to the GetPrinter() MS Platform SDK function. 
631                 </P
632 ></LI
633 ><LI
634 ><P
635 ><B
636 CLASS="COMMAND"
637 >openprinter &lt;printername&gt;</B
638
639                 - Execute an OpenPrinterEx() and ClosePrinter() RPC 
640                 against a given printer. </P
641 ></LI
642 ><LI
643 ><P
644 ><B
645 CLASS="COMMAND"
646 >setdriver &lt;printername&gt;
647                 &lt;drivername&gt;</B
648 >
649                 - Execute a SetPrinter() command to update the printer driver
650                 associated with an installed printer.  The printer driver must
651                 already be correctly installed on the print server.  </P
652 ><P
653 >See also the <B
654 CLASS="COMMAND"
655 >enumprinters</B
656 > and 
657                 <B
658 CLASS="COMMAND"
659 >enumdrivers</B
660 > commands for obtaining a list of
661                 of installed printers and drivers.</P
662 ></LI
663 ></UL
664 ><P
665 ><SPAN
666 CLASS="emphasis"
667 ><I
668 CLASS="EMPHASIS"
669 >GENERAL OPTIONS</I
670 ></SPAN
671 ></P
672 ><P
673 ></P
674 ><UL
675 ><LI
676 ><P
677 ><B
678 CLASS="COMMAND"
679 >debuglevel</B
680 > - Set the current
681                 debug level used to log information.</P
682 ></LI
683 ><LI
684 ><P
685 ><B
686 CLASS="COMMAND"
687 >help (?)</B
688 > - Print a listing of all 
689                 known commands or extended help  on a particular command. 
690                 </P
691 ></LI
692 ><LI
693 ><P
694 ><B
695 CLASS="COMMAND"
696 >quit (exit)</B
697 > - Exit <B
698 CLASS="COMMAND"
699 >rpcclient
700                 </B
701 >.</P
702 ></LI
703 ></UL
704 ></DIV
705 ><DIV
706 CLASS="REFSECT1"
707 ><A
708 NAME="AEN227"
709 ></A
710 ><H2
711 >BUGS</H2
712 ><P
713 ><B
714 CLASS="COMMAND"
715 >rpcclient</B
716 > is designed as a developer testing tool 
717         and may not be robust in certain areas (such as command line parsing).  
718         It has been known to  generate a core dump upon failures when invalid 
719         parameters where passed to the interpreter. </P
720 ><P
721 >From Luke Leighton's original rpcclient man page:</P
722 ><P
723 ><SPAN
724 CLASS="emphasis"
725 ><I
726 CLASS="EMPHASIS"
727 >"WARNING!</I
728 ></SPAN
729 > The MSRPC over SMB code has 
730         been developed from examining  Network traces. No documentation is 
731         available from the original creators  (Microsoft) on how MSRPC over 
732         SMB works, or how the individual MSRPC services  work. Microsoft's 
733         implementation of these services has been demonstrated  (and reported) 
734         to be... a bit flaky in places. </P
735 ><P
736 >The development of Samba's implementation is also a bit rough, 
737         and as more  of the services are understood, it can even result in 
738         versions of  <B
739 CLASS="COMMAND"
740 >smbd(8)</B
741 > and <B
742 CLASS="COMMAND"
743 >rpcclient(1)</B
744
745         that are incompatible for some commands or  services. Additionally, 
746         the developers are sending reports to Microsoft,  and problems found 
747         or reported to Microsoft are fixed in Service Packs,  which may 
748         result in incompatibilities." </P
749 ></DIV
750 ><DIV
751 CLASS="REFSECT1"
752 ><A
753 NAME="AEN237"
754 ></A
755 ><H2
756 >VERSION</H2
757 ><P
758 >This man page is correct for version 3.0 of the Samba 
759         suite.</P
760 ></DIV
761 ><DIV
762 CLASS="REFSECT1"
763 ><A
764 NAME="AEN240"
765 ></A
766 ><H2
767 >AUTHOR</H2
768 ><P
769 >The original Samba software and related utilities 
770         were created by Andrew Tridgell. Samba is now developed
771         by the Samba Team as an Open Source project similar 
772         to the way the Linux kernel is developed.</P
773 ><P
774 >The original rpcclient man page was written by Matthew 
775         Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter.  
776         The conversion to DocBook for Samba 2.2 was done by Gerald 
777         Carter.</P
778 ></DIV
779 ></BODY
780 ></HTML
781 >