This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[samba.git] / docs / manpages / rpcclient.1
1 .\" This manpage has been automatically generated by docbook2man 
2 .\" from a DocBook document.  This tool can be found at:
3 .\" <http://shell.ipoline.com/~elmert/comp/docbook2X/> 
4 .\" Please send any bug reports, improvements, comments, patches, 
5 .\" etc. to Steve Cheng <steve@ggi-project.org>.
6 .TH "RPCCLIENT" "1" "04 March 2003" "" ""
7 .SH NAME
8 rpcclient \- tool for executing client side  MS-RPC functions
9 .SH SYNOPSIS
10
11 \fBrpcclient\fR [ \fB-A authfile\fR ] [ \fB-c <command string>\fR ] [ \fB-d debuglevel\fR ] [ \fB-h\fR ] [ \fB-l logfile\fR ] [ \fB-N\fR ] [ \fB-s <smb config file>\fR ] [ \fB-U username[%password]\fR ] [ \fB-W workgroup\fR ] [ \fB-N\fR ] [ \fB-I destinationIP\fR ] \fBserver\fR
12
13 .SH "DESCRIPTION"
14 .PP
15 This tool is part of the  Samba suite.
16 .PP
17 \fBrpcclient\fR is a utility initially developed
18 to test MS-RPC functionality in Samba itself.  It has undergone 
19 several stages of development and stability.  Many system administrators
20 have now written scripts around it to manage Windows NT clients from 
21 their UNIX workstation. 
22 .SH "OPTIONS"
23 .TP
24 \fBserver\fR
25 NetBIOS name of Server to which to connect. 
26 The server can be  any SMB/CIFS server.  The name is 
27 resolved using the   \fIname resolve order\fR line from 
28 \fIsmb.conf(5)\fR.
29 .TP
30 \fB-A|--authfile=filename\fR
31 This option allows 
32 you to specify a file from which to read the username and 
33 password used in the connection.  The format of the file is 
34
35
36 .nf
37                 username = <value> 
38                 password = <value>
39                 domain   = <value>
40                 
41 .fi
42
43 Make certain that the permissions on the file restrict 
44 access from unwanted users. 
45 .TP
46 \fB-c|--command='command string'\fR
47 execute semicolon separated commands (listed 
48 below)) 
49 .TP
50 \fB-d|--debug=debuglevel\fR
51 \fIdebuglevel\fR is an integer 
52 from 0 to 10.  The default value if this parameter is 
53 not specified is zero.
54
55 The higher this value, the more detail will be 
56 logged to the log files about the activities of the 
57 server. At level 0, only critical errors and serious 
58 warnings will be logged. Level 1 is a reasonable level for
59 day to day running - it generates a small amount of 
60 information about operations carried out.
61
62 Levels above 1 will generate considerable 
63 amounts of log data, and should only be used when 
64 investigating a problem. Levels above 3 are designed for 
65 use only by developers and generate HUGE amounts of log
66 data, most of which is extremely cryptic.
67
68 Note that specifying this parameter here will 
69 override the log
70 level file.
71 .TP
72 \fB-h|--help\fR
73 Print a summary of command line options.
74 .TP
75 \fB-I IP-address\fR
76 \fIIP address\fR is the address of the server to connect to. 
77 It should be specified in standard "a.b.c.d" notation. 
78
79 Normally the client would attempt to locate a named 
80 SMB/CIFS server by looking it up via the NetBIOS name resolution 
81 mechanism described above in the \fIname resolve order\fR 
82 parameter above. Using this parameter will force the client
83 to assume that the server is on the machine with the specified IP 
84 address and the NetBIOS name component of the resource being 
85 connected to will be ignored. 
86
87 There is no default for this parameter. If not supplied, 
88 it will be determined automatically by the client as described 
89 above. 
90 .TP
91 \fB-l|--logfile=logbasename\fR
92 File name for log/debug files. The extension 
93 \&'.client' will be appended. The log file is
94 never removed by the client.
95 .TP
96 \fB-N|--nopass\fR
97 instruct \fBrpcclient\fR not to ask 
98 for a password.   By default, \fBrpcclient\fR will
99 prompt for a password.  See also the \fI-U\fR
100 option.
101 .TP
102 \fB-s|--conf=smb.conf\fR
103 Specifies the location of the all-important 
104 \fIsmb.conf\fR file. 
105 .TP
106 \fB-U|--user=username[%password]\fR
107 Sets the SMB username or username and password. 
108
109 If %password is not specified, the user will be prompted. The 
110 client will first check the \fBUSER\fR environment variable, then the 
111 \fBLOGNAME\fR variable and if either exists, the 
112 string is uppercased. If these environmental variables are not 
113 found, the username GUEST is used. 
114
115 A third option is to use a credentials file which 
116 contains the plaintext of the username and password.  This 
117 option is mainly provided for scripts where the admin does not 
118 wish to pass the credentials on the command line or via environment 
119 variables. If this method is used, make certain that the permissions 
120 on the file restrict access from unwanted users.  See the 
121 \fI-A\fR for more details. 
122
123 Be cautious about including passwords in scripts. Also, on 
124 many systems the command line of a running process may be seen 
125 via the \fBps\fR command.  To be safe always allow 
126 \fBrpcclient\fR to prompt for a password and type 
127 it in directly. 
128 .TP
129 \fB-W|--workgroup=domain\fR
130 Set the SMB domain of the username.   This 
131 overrides the default domain which is the domain defined in 
132 smb.conf.  If the domain specified is the same as the server's NetBIOS name, 
133 it causes the client to log on using the  server's local SAM (as 
134 opposed to the Domain SAM). 
135 .SH "COMMANDS"
136 .PP
137 \fBLSARPC\fR
138 .TP 0.2i
139 \(bu
140 \fBlsaquery\fR
141 .TP 0.2i
142 \(bu
143 \fBlookupsids\fR - Resolve a list 
144 of SIDs to usernames.
145 .TP 0.2i
146 \(bu
147 \fBlookupnames\fR - Resolve a list 
148 of usernames to SIDs.
149 .TP 0.2i
150 \(bu
151 \fBenumtrusts\fR
152 .PP
153 .PP
154 \fBSAMR\fR
155 .TP 0.2i
156 \(bu
157 \fBqueryuser\fR
158 .TP 0.2i
159 \(bu
160 \fBquerygroup\fR
161 .TP 0.2i
162 \(bu
163 \fBqueryusergroups\fR
164 .TP 0.2i
165 \(bu
166 \fBquerygroupmem\fR
167 .TP 0.2i
168 \(bu
169 \fBqueryaliasmem\fR
170 .TP 0.2i
171 \(bu
172 \fBquerydispinfo\fR
173 .TP 0.2i
174 \(bu
175 \fBquerydominfo\fR
176 .TP 0.2i
177 \(bu
178 \fBenumdomgroups\fR
179 .PP
180 .PP
181 \fBSPOOLSS\fR
182 .TP 0.2i
183 \(bu
184 \fBadddriver <arch> <config>\fR 
185 - Execute an AddPrinterDriver() RPC to install the printer driver 
186 information on the server.  Note that the driver files should 
187 already exist in the directory returned by  
188 \fBgetdriverdir\fR.  Possible values for 
189 \fIarch\fR are the same as those for 
190 the \fBgetdriverdir\fR command.
191 The \fIconfig\fR parameter is defined as 
192 follows: 
193
194
195 .nf
196                 Long Printer Name:\\
197                 Driver File Name:\\
198                 Data File Name:\\
199                 Config File Name:\\
200                 Help File Name:\\
201                 Language Monitor Name:\\
202                 Default Data Type:\\
203                 Comma Separated list of Files
204                 
205 .fi
206
207 Any empty fields should be enter as the string "NULL". 
208
209 Samba does not need to support the concept of Print Monitors
210 since these only apply to local printers whose driver can make
211 use of a bi-directional link for communication.  This field should 
212 be "NULL".   On a remote NT print server, the Print Monitor for a 
213 driver must already be installed prior to adding the driver or 
214 else the RPC will fail. 
215 .TP 0.2i
216 \(bu
217 \fBaddprinter <printername> 
218 <sharename> <drivername> <port>\fR 
219 - Add a printer on the remote server.  This printer 
220 will be automatically shared.  Be aware that the printer driver 
221 must already be installed on the server (see \fBadddriver\fR) 
222 and the \fIport\fRmust be a valid port name (see
223 \fBenumports\fR.
224 .TP 0.2i
225 \(bu
226 \fBdeldriver\fR - Delete the 
227 specified printer driver for all architectures.  This
228 does not delete the actual driver files from the server,
229 only the entry from the server's list of drivers.
230 .TP 0.2i
231 \(bu
232 \fBenumdata\fR - Enumerate all 
233 printer setting data stored on the server. On Windows NT  clients, 
234 these values are stored  in the registry, while Samba servers 
235 store them in the printers TDB.  This command corresponds
236 to the MS Platform SDK GetPrinterData() function (* This
237 command is currently unimplemented).
238 .TP 0.2i
239 \(bu
240 \fBenumjobs <printer>\fR 
241 - List the jobs and status of a given printer. 
242 This command corresponds to the MS Platform SDK EnumJobs() 
243 function (* This command is currently unimplemented).
244 .TP 0.2i
245 \(bu
246 \fBenumports [level]\fR 
247 - Executes an EnumPorts() call using the specified 
248 info level. Currently only info levels 1 and 2 are supported. 
249 .TP 0.2i
250 \(bu
251 \fBenumdrivers [level]\fR 
252 - Execute an EnumPrinterDrivers() call.  This lists the various installed 
253 printer drivers for all architectures.  Refer to the MS Platform SDK 
254 documentation for more details of the various flags and calling 
255 options. Currently supported info levels are 1, 2, and 3.
256 .TP 0.2i
257 \(bu
258 \fBenumprinters [level]\fR 
259 - Execute an EnumPrinters() call.  This lists the various installed 
260 and share printers.  Refer to the MS Platform SDK documentation for 
261 more details of the various flags and calling options. Currently
262 supported info levels are 0, 1, and 2.
263 .TP 0.2i
264 \(bu
265 \fBgetdata <printername>\fR 
266 - Retrieve the data for a given printer setting.  See 
267 the  \fBenumdata\fR command for more information.  
268 This command corresponds to the GetPrinterData() MS Platform 
269 SDK function (* This command is currently unimplemented). 
270 .TP 0.2i
271 \(bu
272 \fBgetdriver <printername>\fR 
273 - Retrieve the printer driver information (such as driver file, 
274 config file, dependent files, etc...) for 
275 the given printer. This command corresponds to the GetPrinterDriver()
276 MS Platform  SDK function. Currently info level 1, 2, and 3 are supported.
277 .TP 0.2i
278 \(bu
279 \fBgetdriverdir <arch>\fR 
280 - Execute a GetPrinterDriverDirectory()
281 RPC to retrieve the SMB share name and subdirectory for 
282 storing printer driver files for a given architecture.  Possible 
283 values for \fIarch\fR are "Windows 4.0" 
284 (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
285 Alpha_AXP", and "Windows NT R4000". 
286 .TP 0.2i
287 \(bu
288 \fBgetprinter <printername>\fR 
289 - Retrieve the current printer information.  This command 
290 corresponds to the GetPrinter() MS Platform SDK function. 
291 .TP 0.2i
292 \(bu
293 \fBopenprinter <printername>\fR 
294 - Execute an OpenPrinterEx() and ClosePrinter() RPC 
295 against a given printer. 
296 .TP 0.2i
297 \(bu
298 \fBsetdriver <printername>
299 <drivername>\fR
300 - Execute a SetPrinter() command to update the printer driver
301 associated with an installed printer.  The printer driver must
302 already be correctly installed on the print server.  
303
304 See also the \fBenumprinters\fR and 
305 \fBenumdrivers\fR commands for obtaining a list of
306 of installed printers and drivers.
307 .PP
308 \fBGENERAL OPTIONS\fR
309 .TP 0.2i
310 \(bu
311 \fBdebuglevel\fR - Set the current
312 debug level used to log information.
313 .TP 0.2i
314 \(bu
315 \fBhelp (?)\fR - Print a listing of all 
316 known commands or extended help  on a particular command. 
317 .TP 0.2i
318 \(bu
319 \fBquit (exit)\fR - Exit \fBrpcclient
320 \fR.
321 .SH "BUGS"
322 .PP
323 \fBrpcclient\fR is designed as a developer testing tool 
324 and may not be robust in certain areas (such as command line parsing).  
325 It has been known to  generate a core dump upon failures when invalid 
326 parameters where passed to the interpreter. 
327 .PP
328 From Luke Leighton's original rpcclient man page:
329 .PP
330 \fB"WARNING!\fR The MSRPC over SMB code has 
331 been developed from examining  Network traces. No documentation is 
332 available from the original creators  (Microsoft) on how MSRPC over 
333 SMB works, or how the individual MSRPC services  work. Microsoft's 
334 implementation of these services has been demonstrated  (and reported) 
335 to be... a bit flaky in places. 
336 .PP
337 The development of Samba's implementation is also a bit rough, 
338 and as more  of the services are understood, it can even result in 
339 versions of  \fBsmbd(8)\fR and \fBrpcclient(1)\fR 
340 that are incompatible for some commands or  services. Additionally, 
341 the developers are sending reports to Microsoft,  and problems found 
342 or reported to Microsoft are fixed in Service Packs,  which may 
343 result in incompatibilities." 
344 .SH "VERSION"
345 .PP
346 This man page is correct for version 3.0 of the Samba 
347 suite.
348 .SH "AUTHOR"
349 .PP
350 The original Samba software and related utilities 
351 were created by Andrew Tridgell. Samba is now developed
352 by the Samba Team as an Open Source project similar 
353 to the way the Linux kernel is developed.
354 .PP
355 The original rpcclient man page was written by Matthew 
356 Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter.  
357 The conversion to DocBook for Samba 2.2 was done by Gerald 
358 Carter.