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