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