version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
RPCCLIENT |
|
|
2 |
!!!RPCCLIENT |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
COMMANDS |
|
|
8 |
BUGS |
|
|
9 |
VERSION |
|
|
10 |
AUTHOR |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
rpcclient - tool for executing client side MS-RPC functions |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__rpcclient server__ [[ __-A authfile__ ] [[ __-c |
|
|
20 |
__ ] [[ __-d debuglevel__ ] [[ |
|
|
21 |
__-h__ ] [[ __-l logfile__ ] [[ __-N__ ] [[ __-s |
|
|
22 |
__ ] [[ __-U |
|
|
23 |
username[[%password]__ ] [[ __-W workgroup__ ] [[ |
|
|
24 |
__-N__ ] |
|
|
25 |
!!DESCRIPTION |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
This tool is part of the Sambasuite. |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
__rpcclient__ is a utility initially developed to test |
|
|
32 |
MS-RPC functionality in Samba itself. It has undergone |
|
|
33 |
several stages of development and stability. Many system |
|
|
34 |
administrators have now written scripts around it to manage |
|
|
35 |
Windows NT clients from their UNIX workstation. |
|
|
36 |
!!OPTIONS |
|
|
37 |
|
|
|
38 |
|
|
|
39 |
__server__ |
|
|
40 |
|
|
|
41 |
|
|
|
42 |
NetBIOS name of Server to which to connect. The server can |
|
|
43 |
be any SMB/CIFS server. The name is resolved using the |
|
|
44 |
''name resolve order''line from |
|
|
45 |
''smb.conf(5)''. |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
__-A filename__ |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
This option allows you to specify a file from which to read |
|
|
52 |
the username and password used in the connection. The format |
|
|
53 |
of the file is |
|
|
54 |
|
|
|
55 |
|
|
|
56 |
username = |
|
|
57 |
Make certain that the permissions on the file restrict access from unwanted users. |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
__-c 'command string'__ |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
execute semicolon separated commands (listed |
|
|
64 |
below)) |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
__-d debuglevel__ |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
set the debuglevel. Debug level 0 is the lowest and 100 |
|
|
71 |
being the highest. This should be set to 100 if you are |
|
|
72 |
planning on submitting a bug report to the Samba team (see |
|
|
73 |
''BUGS.txt''). |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
__-h__ |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
Print a summary of command line options. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
__-l logbasename__ |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
File name for log/debug files. The extension '.client' will |
|
|
86 |
be appended. The log file is never removed by the |
|
|
87 |
client. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__-N__ |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
instruct __rpcclient__ not to ask for a password. By |
|
|
94 |
default, __rpcclient__ will prompt for a password. See |
|
|
95 |
also the ''-U'' option. |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
__-s smb.conf__ |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
Specifies the location of the all important ''smb.conf'' |
|
|
102 |
file. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
__-U username[[%password]__ |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
Sets the SMB username or username and password. |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
If %password is not specified, the user will be prompted. |
|
|
112 |
The client will first check the __USER__ environment |
|
|
113 |
variable, then the __LOGNAME__ variable and if either |
|
|
114 |
exists, the string is uppercased. If these environmental |
|
|
115 |
variables are not found, the username GUEST is |
|
|
116 |
used. |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
A third option is to use a credentials file which contains |
|
|
120 |
the plaintext of the username and password. This option is |
|
|
121 |
mainly provided for scripts where the admin doesn't desire |
|
|
122 |
to pass the credentials on the command line or via |
|
|
123 |
environment variables. If this method is used, make certain |
|
|
124 |
that the permissions on the file restrict access from |
|
|
125 |
unwanted users. See the ''-A'' for more |
|
|
126 |
details. |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
Be cautious about including passwords in scripts. Also, on |
|
|
130 |
many systems the command line of a running process may be |
|
|
131 |
seen via the __ps__ command. To be safe always allow |
|
|
132 |
__rpcclient__ to prompt for a password and type it in |
|
|
133 |
directly. |
|
|
134 |
|
|
|
135 |
|
|
|
136 |
__-W domain__ |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
Set the SMB domain of the username. This overrides the |
|
|
140 |
default domain which is the domain defined in smb.conf. If |
|
|
141 |
the domain specified is the same as the server's NetBIOS |
|
|
142 |
name, it causes the client to log on using the server's |
|
|
143 |
local SAM (as opposed to the Domain SAM). |
|
|
144 |
!!COMMANDS |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
__LSARPC__ |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
__lsaquery__ |
|
|
151 |
|
|
|
152 |
|
|
|
153 |
__lookupsids__ - Resolve a list of SIDs to |
|
|
154 |
usernames. |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
__lookupnames__ - Resolve s list of usernames to |
|
|
158 |
SIDs. |
|
|
159 |
|
|
|
160 |
|
|
|
161 |
__enumtrusts__ |
|
|
162 |
|
|
|
163 |
|
|
|
164 |
__SAMR__ |
|
|
165 |
|
|
|
166 |
|
|
|
167 |
__queryuser__ |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
__querygroup__ |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
__queryusergroups__ |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
__querygroupmem__ |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
__queryaliasmem__ |
|
|
180 |
|
|
|
181 |
|
|
|
182 |
__querydispinfo__ |
|
|
183 |
|
|
|
184 |
|
|
|
185 |
__querydominfo__ |
|
|
186 |
|
|
|
187 |
|
|
|
188 |
__enumdomgroups__ |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
__SPOOLSS__ |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
__adddriver __ - Execute an |
2 |
perry |
195 |
!AddPrinterDriver() RPC to install the printer driver |
1 |
perry |
196 |
information on the server. Note that the driver files should |
|
|
197 |
already exist in the directory returned by |
|
|
198 |
__getdriverdir__. Possible values for ''arch'' are the |
|
|
199 |
same as those for the __getdriverdir__ command. The |
|
|
200 |
''config'' parameter is defined as follows: |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
Long Printer Name:\ |
|
|
204 |
Driver File Name:\ |
|
|
205 |
Data File Name:\ |
|
|
206 |
Config File Name:\ |
|
|
207 |
Help File Name:\ |
|
|
208 |
Language Monitor Name:\ |
|
|
209 |
Default Data Type:\ |
|
|
210 |
Comma Separated list of Files |
|
|
211 |
Any empty fields should be enter as the string |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Samba does not need to support the concept of Print Monitors |
|
|
215 |
since these only apply to local printers whose driver can |
|
|
216 |
make use of a bi-directional link for communication. This |
|
|
217 |
field should be |
|
|
218 |
|
|
|
219 |
|
|
|
220 |
__addprinter |
|
|
221 |
__ - Add a printer on the |
|
|
222 |
remote server. This printer will be automatically shared. Be |
|
|
223 |
aware that the printer driver must already be installed on |
|
|
224 |
the server (see __adddriver__) and the ''port''must be |
|
|
225 |
a valid port name (see __enumports__. |
|
|
226 |
|
|
|
227 |
|
|
|
228 |
__deldriver__ - Delete the specified printer driver for |
|
|
229 |
all architectures. This does not delete the actual driver |
|
|
230 |
files from the server, only the entry from the server's list |
|
|
231 |
of drivers. |
|
|
232 |
|
|
|
233 |
|
|
|
234 |
__enumdata__ - Enumerate all printer setting data stored |
|
|
235 |
on the server. On Windows NT clients, these values are |
|
|
236 |
stored in the registry, while Samba servers store them in |
|
|
237 |
the printers TDB. This command corresponds to the MS |
2 |
perry |
238 |
Platform SDK !GetPrinterData() function (* This command is |
1 |
perry |
239 |
currently unimplemented). |
|
|
240 |
|
|
|
241 |
|
|
|
242 |
__enumjobs __ - List the jobs and status |
|
|
243 |
of a given printer. This command corresponds to the MS |
2 |
perry |
244 |
Platform SDK !EnumJobs() function (* This command is |
1 |
perry |
245 |
currently unimplemented). |
|
|
246 |
|
|
|
247 |
|
2 |
perry |
248 |
__enumports [[level]__ - Executes an !EnumPorts() call |
1 |
perry |
249 |
using the specified info level. Currently only info levels 1 |
|
|
250 |
and 2 are supported. |
|
|
251 |
|
|
|
252 |
|
2 |
perry |
253 |
__enumdrivers [[level]__ - Execute an !EnumPrinterDrivers() |
1 |
perry |
254 |
call. This lists the various installed printer drivers for |
|
|
255 |
all architectures. Refer to the MS Platform SDK |
|
|
256 |
documentation for more details of the various flags and |
|
|
257 |
calling options. Currently supported info levels are 1, 2, |
|
|
258 |
and 3. |
|
|
259 |
|
|
|
260 |
|
2 |
perry |
261 |
__enumprinters [[level]__ - Execute an !EnumPrinters() |
1 |
perry |
262 |
call. This lists the various installed and share printers. |
|
|
263 |
Refer to the MS Platform SDK documentation for more details |
|
|
264 |
of the various flags and calling options. Currently |
|
|
265 |
supported info levels are 0, 1, and 2. |
|
|
266 |
|
|
|
267 |
|
|
|
268 |
__getdata __ - Retrieve the data for a |
|
|
269 |
given printer setting. See the __enumdata__ command for |
|
|
270 |
more information. This command corresponds to the |
2 |
perry |
271 |
!GetPrinterData() MS Platform SDK function (* This command is |
1 |
perry |
272 |
currently unimplemented). |
|
|
273 |
|
|
|
274 |
|
|
|
275 |
__getdriver __ - Retrieve the printer |
|
|
276 |
driver information (such as driver file, config file, |
|
|
277 |
dependent files, etc...) for the given printer. This command |
2 |
perry |
278 |
corresponds to the !GetPrinterDriver() MS Platform SDK |
1 |
perry |
279 |
function. Currently info level 1, 2, and 3 are |
|
|
280 |
supported. |
|
|
281 |
|
|
|
282 |
|
|
|
283 |
__getdriverdir __ - Execute a |
2 |
perry |
284 |
!GetPrinterDriverDirectory() RPC to retreive the SMB share |
1 |
perry |
285 |
name and subdirectory for storing printer driver files for a |
|
|
286 |
given architecture. Possible values for ''arch'' are |
|
|
287 |
'' |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
__getprinter __ - Retrieve the current |
|
|
291 |
printer information. This command corresponds to the |
2 |
perry |
292 |
!GetPrinter() MS Platform SDK function. |
1 |
perry |
293 |
|
|
|
294 |
|
|
|
295 |
__openprinter __ - Execute an |
2 |
perry |
296 |
!OpenPrinterEx() and !ClosePrinter() RPC against a given |
1 |
perry |
297 |
printer. |
|
|
298 |
|
|
|
299 |
|
|
|
300 |
__setdriver __ - |
2 |
perry |
301 |
Execute a !SetPrinter() command to update the printer driver |
1 |
perry |
302 |
associated with an installed printer. The printer driver |
|
|
303 |
must already be correctly installed on the print |
|
|
304 |
server. |
|
|
305 |
|
|
|
306 |
|
|
|
307 |
See also the __enumprinters__ and __enumdrivers__ |
|
|
308 |
commands for obtaining a list of of installed printers and |
|
|
309 |
drivers. |
|
|
310 |
|
|
|
311 |
|
|
|
312 |
__GENERAL OPTIONS__ |
|
|
313 |
|
|
|
314 |
|
|
|
315 |
__debuglevel__ - Set the current debug level used to log |
|
|
316 |
information. |
|
|
317 |
|
|
|
318 |
|
|
|
319 |
__help (?)__ - Print a listing of all known commands or |
|
|
320 |
extended help on a particular command. |
|
|
321 |
|
|
|
322 |
|
|
|
323 |
__quit (exit)__ - Exit __rpcclient__ . |
|
|
324 |
!!BUGS |
|
|
325 |
|
|
|
326 |
|
|
|
327 |
__rpcclient__ is designed as a developer testing tool and |
|
|
328 |
may not be robust in certain areas (such as command line |
|
|
329 |
parsing). It has been known to generate a core dump upon |
|
|
330 |
failures when invalid parameters where passed to the |
|
|
331 |
interpreter. |
|
|
332 |
|
|
|
333 |
|
|
|
334 |
From Luke Leighton's original rpcclient man |
|
|
335 |
page: |
|
|
336 |
|
|
|
337 |
|
|
|
338 |
____ The MSRPC over SMB code has been |
|
|
339 |
developed from examining Network traces. No documentation is |
|
|
340 |
available from the original creators (Microsoft) on how |
|
|
341 |
MSRPC over SMB works, or how the individual MSRPC services |
|
|
342 |
work. Microsoft's implementation of these services has been |
|
|
343 |
demonstrated (and reported) to be... a bit flaky in |
|
|
344 |
places. |
|
|
345 |
|
|
|
346 |
|
|
|
347 |
The development of Samba's implementation is also a bit |
|
|
348 |
rough, and as more of the services are understood, it can |
|
|
349 |
even result in versions of __smbd(8)__ and |
|
|
350 |
__rpcclient(1)__ that are incompatible for some commands |
|
|
351 |
or services. Additionally, the developers are sending |
|
|
352 |
reports to Microsoft, and problems found or reported to |
|
|
353 |
Microsoft are fixed in Service Packs, which may result in |
|
|
354 |
incompatibilities.__ |
|
|
355 |
!!VERSION |
|
|
356 |
|
|
|
357 |
|
|
|
358 |
This man page is correct for version 2.2 of the Samba |
|
|
359 |
suite. |
|
|
360 |
!!AUTHOR |
|
|
361 |
|
|
|
362 |
|
|
|
363 |
The original Samba software and related utilities were |
|
|
364 |
created by Andrew Tridgell. Samba is now developed by the |
|
|
365 |
Samba Team as an Open Source project similar to the way the |
|
|
366 |
Linux kernel is developed. |
|
|
367 |
|
|
|
368 |
|
|
|
369 |
The original rpcclient man page was written by Matthew |
|
|
370 |
Geddes, Luke Kenneth Casson Leighton, and rewritten by |
2 |
perry |
371 |
Gerald Carter. The conversion to !DocBook for Samba 2.2 was |
1 |
perry |
372 |
done by Gerald Carter. |
|
|
373 |
---- |