syncing up changes in 2.2
[Samba.git] / docs / htmldocs / rpcclient.1.html
blob786dd6c866820e95b7b587886051aeaf7743ef14
1 <HTML
2 ><HEAD
3 ><TITLE
4 >rpcclient</TITLE
5 ><META
6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.57"></HEAD
8 ><BODY
9 CLASS="REFENTRY"
10 BGCOLOR="#FFFFFF"
11 TEXT="#000000"
12 LINK="#0000FF"
13 VLINK="#840084"
14 ALINK="#0000FF"
15 ><H1
16 ><A
17 NAME="RPCCLIENT"
18 >rpcclient</A
19 ></H1
20 ><DIV
21 CLASS="REFNAMEDIV"
22 ><A
23 NAME="AEN5"
24 ></A
25 ><H2
26 >Name</H2
27 >rpcclient&nbsp;--&nbsp;tool for executing client side
28 MS-RPC functions</DIV
29 ><DIV
30 CLASS="REFSYNOPSISDIV"
31 ><A
32 NAME="AEN8"
33 ></A
34 ><H2
35 >Synopsis</H2
36 ><P
37 ><B
38 CLASS="COMMAND"
39 >rpcclient</B
40 > {server} [-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]</P
41 ></DIV
42 ><DIV
43 CLASS="REFSECT1"
44 ><A
45 NAME="AEN22"
46 ></A
47 ><H2
48 >DESCRIPTION</H2
49 ><P
50 >This tool is part of the <A
51 HREF="samba.7.html"
52 TARGET="_top"
53 > Samba</A
54 > suite.</P
55 ><P
56 ><B
57 CLASS="COMMAND"
58 >rpcclient</B
59 > is a utility initially developed
60 to test MS-RPC functionality in Samba itself. It has undergone
61 several stages of development and stability. Many system administrators
62 have now written scripts around it to manage Windows NT clients from
63 their UNIX workstation. </P
64 ></DIV
65 ><DIV
66 CLASS="REFSECT1"
67 ><A
68 NAME="AEN28"
69 ></A
70 ><H2
71 >OPTIONS</H2
72 ><P
73 ></P
74 ><DIV
75 CLASS="VARIABLELIST"
76 ><DL
77 ><DT
78 >server</DT
79 ><DD
80 ><P
81 >NetBIOS name of Server to which to connect.
82 The server can be any SMB/CIFS server. The name is
83 resolved using the <A
84 HREF="smb.conf.5.html#NAMERESOLVEORDER"
85 TARGET="_top"
86 > <TT
87 CLASS="PARAMETER"
88 ><I
89 >name resolve order</I
90 ></TT
91 ></A
92 > line from
93 <TT
94 CLASS="FILENAME"
95 >smb.conf(5)</TT
96 >.</P
97 ></DD
98 ><DT
99 >-A filename</DT
100 ><DD
102 >This option allows
103 you to specify a file from which to read the username and
104 password used in the connection. The format of the file is
107 ><TABLE
108 BORDER="0"
109 BGCOLOR="#E0E0E0"
110 WIDTH="90%"
111 ><TR
112 ><TD
113 ><PRE
114 CLASS="PROGRAMLISTING"
115 > username = &#60;value&#62;
116 password = &#60;value&#62;
117 domain = &#60;value&#62;
118 </PRE
119 ></TD
120 ></TR
121 ></TABLE
122 ></P
124 >Make certain that the permissions on the file restrict
125 access from unwanted users. </P
126 ></DD
127 ><DT
128 >-c 'command string'</DT
129 ><DD
131 >execute semicolon separated commands (listed
132 below)) </P
133 ></DD
134 ><DT
135 >-d debuglevel</DT
136 ><DD
138 >set the debuglevel. Debug level 0 is the lowest
139 and 100 being the highest. This should be set to 100 if you are
140 planning on submitting a bug report to the Samba team (see BUGS.txt).
142 ></DD
143 ><DT
144 >-h</DT
145 ><DD
147 >Print a summary of command line options.
149 ></DD
150 ><DT
151 >-l logbasename</DT
152 ><DD
154 >File name for log/debug files. .client will be
155 appended. The log file is never removed by the client.
157 ></DD
158 ><DT
159 >-N</DT
160 ><DD
162 >instruct <B
163 CLASS="COMMAND"
164 >rpcclient</B
165 > not to ask
166 for a password. By default, <B
167 CLASS="COMMAND"
168 >rpcclient</B
169 > will prompt
170 for a password. See also the <TT
171 CLASS="PARAMETER"
173 >-U</I
174 ></TT
175 > option.</P
176 ></DD
177 ><DT
178 >-s smb.conf</DT
179 ><DD
181 >Specifies the location of the all important
183 CLASS="FILENAME"
184 >smb.conf</TT
185 > file. </P
186 ></DD
187 ><DT
188 >-U username[%password]</DT
189 ><DD
191 >Sets the SMB username or username and password. </P
193 >If %password is not specified, The user will be prompted. The
194 client will first check the <TT
195 CLASS="ENVAR"
196 >USER</TT
197 > environment variable, then the
199 CLASS="ENVAR"
200 >LOGNAME</TT
201 > variable and if either exist, the
202 string is uppercased. If these environmental variables are not
203 found, the username <TT
204 CLASS="CONSTANT"
205 >GUEST</TT
206 > is used. </P
208 >A third option is to use a credentials file which
209 contains the plaintext of the username and password. This
210 option is mainly provided for scripts where the admin doesn't
211 desire to pass the credentials on the command line or via environment
212 variables. If this method is used, make certain that the permissions
213 on the file restrict access from unwanted users. See the
215 CLASS="PARAMETER"
217 >-A</I
218 ></TT
219 > for more details. </P
221 >Be cautious about including passwords in scripts. Also, on
222 many systems the command line of a running process may be seen
223 via the <B
224 CLASS="COMMAND"
225 >ps</B
226 > command. To be safe always allow
228 CLASS="COMMAND"
229 >rpcclient</B
230 > to prompt for a password and type
231 it in directly. </P
232 ></DD
233 ><DT
234 >-W domain</DT
235 ><DD
237 >Set the SMB domain of the username. This
238 overrides the default domain which is the domain of the
239 server specified with the <TT
240 CLASS="PARAMETER"
242 >-S</I
243 ></TT
244 > option.
245 If the domain specified is the same as the server's NetBIOS name,
246 it causes the client to log on using the server's local SAM (as
247 opposed to the Domain SAM). </P
248 ></DD
249 ></DL
250 ></DIV
251 ></DIV
252 ><DIV
253 CLASS="REFSECT1"
255 NAME="AEN91"
256 ></A
257 ><H2
258 >COMMANDS</H2
260 ><EM
261 >LSARPC</EM
262 ></P
264 ></P
265 ><UL
266 ><LI
269 CLASS="COMMAND"
270 >lsaquery</B
271 ></P
272 ></LI
273 ><LI
276 CLASS="COMMAND"
277 >lookupsids</B
278 ></P
279 ></LI
280 ><LI
283 CLASS="COMMAND"
284 >lookupnames</B
285 ></P
286 ></LI
287 ><LI
290 CLASS="COMMAND"
291 >enumtrusts</B
292 ></P
293 ></LI
294 ></UL
296 > </P
298 ><EM
299 >SAMR</EM
300 ></P
302 ></P
303 ><UL
304 ><LI
307 CLASS="COMMAND"
308 >queryuser</B
309 ></P
310 ></LI
311 ><LI
314 CLASS="COMMAND"
315 >querygroup</B
316 ></P
317 ></LI
318 ><LI
321 CLASS="COMMAND"
322 >queryusergroups</B
323 ></P
324 ></LI
325 ><LI
328 CLASS="COMMAND"
329 >querygroupmem</B
330 ></P
331 ></LI
332 ></UL
334 > </P
336 ><EM
337 >SPOOLSS</EM
338 ></P
340 ></P
341 ><UL
342 ><LI
345 CLASS="COMMAND"
346 >adddriver &#60;arch&#62; &#60;config&#62;</B
348 - Execute an AddPrinterDriver() RPC to install the printer driver
349 information on the server. Note that the driver files should
350 already exist in the directory returned by
352 CLASS="COMMAND"
353 >getdriverdir</B
354 >. Possible values for
356 CLASS="PARAMETER"
358 >arch</I
359 ></TT
360 > are the same as those for
361 the <B
362 CLASS="COMMAND"
363 >getdriverdir</B
364 > command.
365 The <TT
366 CLASS="PARAMETER"
368 >config</I
369 ></TT
370 > parameter is defined as
371 follows: </P
373 ><TABLE
374 BORDER="0"
375 BGCOLOR="#E0E0E0"
376 WIDTH="90%"
377 ><TR
378 ><TD
379 ><PRE
380 CLASS="PROGRAMLISTING"
381 > Long Printer Name:\
382 Driver File Name:\
383 Data File Name:\
384 Config File Name:\
385 Help File Name:\
386 Language Monitor Name:\
387 Default Data Type:\
388 Comma Separated list of Files
389 </PRE
390 ></TD
391 ></TR
392 ></TABLE
393 ></P
395 >Any empty fields should be enter as the string "NULL". </P
397 >Samba does not need to support the concept of Print Monitors
398 since these only apply to local printers whose driver can make
399 use of a bi-directional link for communication. This field should
400 be "NULL". On a remote NT print server, the Print Monitor for a
401 driver must already be installed prior to adding the driver or
402 else the RPC will fail. </P
403 ></LI
404 ><LI
407 CLASS="COMMAND"
408 >addprinter &#60;printername&#62;
409 &#60;sharename&#62; &#60;drivername&#62; &#60;port&#62;</B
411 - Add a printer on the remote server. This printer
412 will be automatically shared. Be aware that the printer driver
413 must already be installed on the server (see <B
414 CLASS="COMMAND"
415 >adddriver</B
417 and the <TT
418 CLASS="PARAMETER"
420 >port</I
421 ></TT
422 >must be a valid port name (see
424 CLASS="COMMAND"
425 >enumports</B
426 >.</P
427 ></LI
428 ><LI
431 CLASS="COMMAND"
432 >enumdata</B
433 > - Enumerate all
434 printer setting data stored on the server. On Windows NT clients,
435 these values are stored in the registry, while Samba servers
436 store them in the printers TDB. This command corresponds
437 to the MS Platform SDK GetPrinterData() function (* This
438 command is currently unimplemented).</P
439 ></LI
440 ><LI
443 CLASS="COMMAND"
444 >enumjobs &#60;printer&#62;</B
446 - List the jobs and status of a given printer.
447 This command corresponds to the MS Platform SDK EnumJobs()
448 function (* This command is currently unimplemented).</P
449 ></LI
450 ><LI
453 CLASS="COMMAND"
454 >enumports [level]</B
456 - Executes an EnumPorts() call using the specified
457 info level. Currently only info levels 1 and 2 are supported.
459 ></LI
460 ><LI
463 CLASS="COMMAND"
464 >enumdrivers [level]</B
466 - Execute an EnumPrinterDrivers() call. This lists the various installed
467 printer drivers for all architectures. Refer to the MS Platform SDK
468 documentation for more details of the various flags and calling
469 options. Currently supported info levels are 1, 2, and 3.</P
470 ></LI
471 ><LI
474 CLASS="COMMAND"
475 >enumprinters [level]</B
477 - Execute an EnumPrinters() call. This lists the various installed
478 and share printers. Refer to the MS Platform SDK documentation for
479 more details of the various flags and calling options. Currently
480 supported info levels are 0, 1, and 2.</P
481 ></LI
482 ><LI
485 CLASS="COMMAND"
486 >getdata &#60;printername&#62;</B
488 - Retrieve the data for a given printer setting. See
489 the <B
490 CLASS="COMMAND"
491 >enumdata</B
492 > command for more information.
493 This command corresponds to the GetPrinterData() MS Platform
494 SDK function (* This command is currently unimplemented). </P
495 ></LI
496 ><LI
499 CLASS="COMMAND"
500 >getdriver &#60;printername&#62;</B
502 - Retrieve the printer driver information (such as driver file,
503 config file, dependent files, etc...) for
504 the given printer. This command corresponds to the GetPrinterDriver()
505 MS Platform SDK function. Currently info level 1, 2, and 3 are supported.
507 ></LI
508 ><LI
511 CLASS="COMMAND"
512 >getdriverdir &#60;arch&#62;</B
514 - Execute a GetPrinterDriverDirectory()
515 RPC to retreive the SMB share name and subdirectory for
516 storing printer driver files for a given architecture. Possible
517 values for <TT
518 CLASS="PARAMETER"
520 >arch</I
521 ></TT
522 > are "Windows 4.0"
523 (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
524 Alpha_AXP", and "Windows NT R4000". </P
525 ></LI
526 ><LI
529 CLASS="COMMAND"
530 >getprinter &#60;printername&#62;</B
532 - Retrieve the current printer information. This command
533 corresponds to the GetPrinter() MS Platform SDK function.
535 ></LI
536 ><LI
539 CLASS="COMMAND"
540 >openprinter &#60;printername&#62;</B
542 - Execute an OpenPrinterEx() and ClosePrinter() RPC
543 against a given printer. </P
544 ></LI
545 ><LI
548 CLASS="COMMAND"
549 >setdriver &#60;printername&#62; &#60;drivername&#62;</B
551 - Execute a SetPrinter() command to update the printer driver associated
552 with an installed printer. The printer driver must already be correctly
553 installed on the print server. </P
555 >See also the <B
556 CLASS="COMMAND"
557 >enumprinters</B
558 > and
560 CLASS="COMMAND"
561 >enumdrivers</B
562 > commands for obtaining a list of
563 of installed printers and drivers.</P
564 ></LI
565 ></UL
567 ><EM
568 >GENERAL OPTIONS</EM
569 ></P
571 ></P
572 ><UL
573 ><LI
576 CLASS="COMMAND"
577 >debuglevel</B
578 > - Set the current debug level
579 used to log information.</P
580 ></LI
581 ><LI
584 CLASS="COMMAND"
585 >help (?)</B
586 > - Print a listing of all
587 known commands or extended help on a particular command.
589 ></LI
590 ><LI
593 CLASS="COMMAND"
594 >quit (exit)</B
595 > - Exit <B
596 CLASS="COMMAND"
597 >rpcclient
599 >.</P
600 ></LI
601 ></UL
602 ></DIV
603 ><DIV
604 CLASS="REFSECT1"
606 NAME="AEN196"
607 ></A
608 ><H2
609 >BUGS</H2
612 CLASS="COMMAND"
613 >rpcclient</B
614 > is designed as a developer testing tool
615 and may not be robust in certain areas (such as command line parsing).
616 It has been known to generate a core dump upon failures when invalid
617 parameters where passed to the interpreter. </P
619 >From Luke Leighton's original rpcclient man page:</P
621 ><EM
622 >"WARNING!</EM
623 > The MSRPC over SMB code has
624 been developed from examining Network traces. No documentation is
625 available from the original creators (Microsoft) on how MSRPC over
626 SMB works, or how the individual MSRPC services work. Microsoft's
627 implementation of these services has been demonstrated (and reported)
628 to be... a bit flakey in places. </P
630 >The development of Samba's implementation is also a bit rough,
631 and as more of the services are understood, it can even result in
632 versions of <B
633 CLASS="COMMAND"
634 >smbd(8)</B
635 > and <B
636 CLASS="COMMAND"
637 >rpcclient(1)</B
639 that are incompatible for some commands or services. Additionally,
640 the developers are sending reports to Microsoft, and problems found
641 or reported to Microsoft are fixed in Service Packs, which may
642 result in incompatibilities." </P
643 ></DIV
644 ><DIV
645 CLASS="REFSECT1"
647 NAME="AEN206"
648 ></A
649 ><H2
650 >VERSION</H2
652 >This man page is correct for version 2.2 of the Samba
653 suite.</P
654 ></DIV
655 ><DIV
656 CLASS="REFSECT1"
658 NAME="AEN209"
659 ></A
660 ><H2
661 >AUTHOR</H2
663 >The original Samba software and related utilities
664 were created by Andrew Tridgell. Samba is now developed
665 by the Samba Team as an Open Source project similar
666 to the way the Linux kernel is developed.</P
668 >The original rpcclient man page was written by Matthew
669 Geddes, Luke Kenneth Casson, and rewriten by Gerald Carter.
670 The conversion to DocBook for Samba 2.2 was done by Gerald
671 Carter.</P
672 ></DIV
673 ></BODY
674 ></HTML