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