1RPCCLIENT(1)                     User Commands                    RPCCLIENT(1)
2
3
4

NAME

6       rpcclient - tool for executing client side MS-RPC functions
7

SYNOPSIS

9       rpcclient [-A authfile] [-c <command string>] [-d debuglevel] [-h]
10        [-l logdir] [-N] [-s <smb config file>] [-U username[%password]]
11        [-W workgroup] [-I destinationIP] {server}
12

DESCRIPTION

14       This tool is part of the samba(7) suite.
15
16       rpcclient is a utility initially developed to test MS-RPC functionality
17       in Samba itself. It has undergone several stages of development and
18       stability. Many system administrators have now written scripts around
19       it to manage Windows NT clients from their UNIX workstation.
20

OPTIONS

22       server
23           NetBIOS name of Server to which to connect. The server can be any
24           SMB/CIFS server. The name is resolved using the name resolve order
25           line from smb.conf(5).
26
27       -c|--command=´command string´
28           execute semicolon separated commands (listed below))
29
30       -I|--dest-ip IP-address
31           IP address is the address of the server to connect to. It should be
32           specified in standard "a.b.c.d" notation.
33
34           Normally the client would attempt to locate a named SMB/CIFS server
35           by looking it up via the NetBIOS name resolution mechanism
36           described above in the name resolve order parameter above. Using
37           this parameter will force the client to assume that the server is
38           on the machine with the specified IP address and the NetBIOS name
39           component of the resource being connected to will be ignored.
40
41           There is no default for this parameter. If not supplied, it will be
42           determined automatically by the client as described above.
43
44       -p|--port port
45           This number is the TCP port number that will be used when making
46           connections to the server. The standard (well-known) TCP port
47           number for an SMB/CIFS server is 139, which is the default.
48
49       -d|--debuglevel=level
50           level is an integer from 0 to 10. The default value if this
51           parameter is not specified is 0.
52
53           The higher this value, the more detail will be logged to the log
54           files about the activities of the server. At level 0, only critical
55           errors and serious warnings will be logged. Level 1 is a reasonable
56           level for day-to-day running - it generates a small amount of
57           information about operations carried out.
58
59           Levels above 1 will generate considerable amounts of log data, and
60           should only be used when investigating a problem. Levels above 3
61           are designed for use only by developers and generate HUGE amounts
62           of log data, most of which is extremely cryptic.
63
64           Note that specifying this parameter here will override the
65           smb.conf.5.html# parameter in the smb.conf file.
66
67       -V|--version
68           Prints the program version number.
69
70       -s|--configfile <configuration file>
71           The file specified contains the configuration details required by
72           the server. The information in this file includes server-specific
73           information such as what printcap file to use, as well as
74           descriptions of all the services that the server is to provide. See
75           smb.conf for more information. The default configuration file name
76           is determined at compile time.
77
78       -l|--log-basename=logdirectory
79           Base directory name for log/debug files. The extension ".progname"
80           will be appended (e.g. log.smbclient, log.smbd, etc...). The log
81           file is never removed by the client.
82
83       -N|--no-pass
84           If specified, this parameter suppresses the normal password prompt
85           from the client to the user. This is useful when accessing a
86           service that does not require a password.
87
88           Unless a password is specified on the command line or this
89           parameter is specified, the client will request a password.
90
91           If a password is specified on the command line and this option is
92           also defined the password on the command line will be silently
93           ingnored and no password will be used.
94
95       -k|--kerberos
96           Try to authenticate with kerberos. Only useful in an Active
97           Directory environment.
98
99       -C|--use-ccache
100           Try to use the credentials cached by winbind.
101
102       -A|--authentication-file=filename
103           This option allows you to specify a file from which to read the
104           username and password used in the connection. The format of the
105           file is
106
107               username = <value>
108               password = <value>
109               domain   = <value>
110
111           Make certain that the permissions on the file restrict access from
112           unwanted users.
113
114       -U|--user=username[%password]
115           Sets the SMB username or username and password.
116
117           If %password is not specified, the user will be prompted. The
118           client will first check the USER environment variable, then the
119           LOGNAME variable and if either exists, the string is uppercased. If
120           these environmental variables are not found, the username GUEST is
121           used.
122
123           A third option is to use a credentials file which contains the
124           plaintext of the username and password. This option is mainly
125           provided for scripts where the admin does not wish to pass the
126           credentials on the command line or via environment variables. If
127           this method is used, make certain that the permissions on the file
128           restrict access from unwanted users. See the -A for more details.
129
130           Be cautious about including passwords in scripts. Also, on many
131           systems the command line of a running process may be seen via the
132           ps command. To be safe always allow rpcclient to prompt for a
133           password and type it in directly.
134
135       -n|--netbiosname <primary NetBIOS name>
136           This option allows you to override the NetBIOS name that Samba uses
137           for itself. This is identical to setting the smb.conf.5.html#
138           parameter in the smb.conf file. However, a command line setting
139           will take precedence over settings in smb.conf.
140
141       -i|--scope <scope>
142           This specifies a NetBIOS scope that nmblookup will use to
143           communicate with when generating NetBIOS names. For details on the
144           use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
145           scopes are very rarely used, only set this parameter if you are the
146           system administrator in charge of all the NetBIOS systems you
147           communicate with.
148
149       -W|--workgroup=domain
150           Set the SMB domain of the username. This overrides the default
151           domain which is the domain defined in smb.conf. If the domain
152           specified is the same as the servers NetBIOS name, it causes the
153           client to log on using the servers local SAM (as opposed to the
154           Domain SAM).
155
156       -O|--socket-options socket options
157           TCP socket options to set on the client socket. See the socket
158           options parameter in the smb.conf manual page for the list of valid
159           options.
160
161       -h|--help
162           Print a summary of command line options.
163

COMMANDS

165   LSARPC
166       lsaquery
167           Query info policy
168
169       lookupsids
170           Resolve a list of SIDs to usernames.
171
172       lookupnames
173           Resolve a list of usernames to SIDs.
174
175       enumtrusts
176           Enumerate trusted domains
177
178       enumprivs
179           Enumerate privileges
180
181       getdispname
182           Get the privilege name
183
184       lsaenumsid
185           Enumerate the LSA SIDS
186
187       lsaenumprivsaccount
188           Enumerate the privileges of an SID
189
190       lsaenumacctrights
191           Enumerate the rights of an SID
192
193       lsaenumacctwithright
194           Enumerate accounts with a right
195
196       lsaaddacctrights
197           Add rights to an account
198
199       lsaremoveacctrights
200           Remove rights from an account
201
202       lsalookupprivvalue
203           Get a privilege value given its name
204
205       lsaquerysecobj
206           Query LSA security object
207
208   LSARPC-DS
209       dsroledominfo
210           Get Primary Domain Information
211
212       DFS
213
214       dfsexist
215           Query DFS support
216
217       dfsadd
218           Add a DFS share
219
220       dfsremove
221           Remove a DFS share
222
223       dfsgetinfo
224           Query DFS share info
225
226       dfsenum
227           Enumerate dfs shares
228
229   REG
230       shutdown
231           Remote Shutdown
232
233       abortshutdown
234           Abort Shutdown
235
236   SRVSVC
237       srvinfo
238           Server query info
239
240       netshareenum
241           Enumerate shares
242
243       netfileenum
244           Enumerate open files
245
246       netremotetod
247           Fetch remote time of day
248
249   SAMR
250       queryuser
251           Query user info
252
253       querygroup
254           Query group info
255
256       queryusergroups
257           Query user groups
258
259       querygroupmem
260           Query group membership
261
262       queryaliasmem
263           Query alias membership
264
265       querydispinfo
266           Query display info
267
268       querydominfo
269           Query domain info
270
271       enumdomusers
272           Enumerate domain users
273
274       enumdomgroups
275           Enumerate domain groups
276
277       enumalsgroups
278           Enumerate alias groups
279
280       createdomuser
281           Create domain user
282
283       samlookupnames
284           Look up names
285
286       samlookuprids
287           Look up names
288
289       deletedomuser
290           Delete domain user
291
292       samquerysecobj
293           Query SAMR security object
294
295       getdompwinfo
296           Retrieve domain password info
297
298       lookupdomain
299           Look up domain
300
301   SPOOLSS
302       adddriver <arch> <config> [<version>]
303           Execute an AddPrinterDriver() RPC to install the printer driver
304           information on the server. Note that the driver files should
305           already exist in the directory returned by getdriverdir. Possible
306           values for arch are the same as those for the getdriverdir command.
307           The config parameter is defined as follows:
308
309               Long Printer Name:\
310               Driver File Name:\
311               Data File Name:\
312               Config File Name:\
313               Help File Name:\
314               Language Monitor Name:\
315               Default Data Type:\
316               Comma Separated list of Files
317
318           Any empty fields should be enter as the string "NULL".
319
320           Samba does not need to support the concept of Print Monitors since
321           these only apply to local printers whose driver can make use of a
322           bi-directional link for communication. This field should be "NULL".
323           On a remote NT print server, the Print Monitor for a driver must
324           already be installed prior to adding the driver or else the RPC
325           will fail.
326
327           The version parameter lets you specify the printer driver version
328           number. If omitted, the default driver version for the specified
329           architecture will be used. This option can be used to upload
330           Windows 2000 (version 3) printer drivers.
331
332       addprinter <printername> <sharename> <drivername> <port>
333           Add a printer on the remote server. This printer will be
334           automatically shared. Be aware that the printer driver must already
335           be installed on the server (see adddriver) and the portmust be a
336           valid port name (see enumports.
337
338       deldriver
339           Delete the specified printer driver for all architectures. This
340           does not delete the actual driver files from the server, only the
341           entry from the server´s list of drivers.
342
343       deldriverex <driver> [architecture] [version]
344           Delete the specified printer driver including driver files. You can
345           limit this action to a specific architecture and a specific
346           version. If no architecure is given, all driver files of that
347           driver will be deleted.
348
349       enumdata
350           Enumerate all printer setting data stored on the server. On Windows
351           NT clients, these values are stored in the registry, while Samba
352           servers store them in the printers TDB. This command corresponds to
353           the MS Platform SDK GetPrinterData() function (* This command is
354           currently unimplemented).
355
356       enumdataex
357           Enumerate printer data for a key
358
359       enumjobs <printer>
360           List the jobs and status of a given printer. This command
361           corresponds to the MS Platform SDK EnumJobs() function
362
363       enumkey
364           Enumerate printer keys
365
366       enumports [level]
367           Executes an EnumPorts() call using the specified info level.
368           Currently only info levels 1 and 2 are supported.
369
370       enumdrivers [level]
371           Execute an EnumPrinterDrivers() call. This lists the various
372           installed printer drivers for all architectures. Refer to the MS
373           Platform SDK documentation for more details of the various flags
374           and calling options. Currently supported info levels are 1, 2, and
375           3.
376
377       enumprinters [level]
378           Execute an EnumPrinters() call. This lists the various installed
379           and share printers. Refer to the MS Platform SDK documentation for
380           more details of the various flags and calling options. Currently
381           supported info levels are 1, 2 and 5.
382
383       getdata <printername> <valuename;>
384           Retrieve the data for a given printer setting. See the enumdata
385           command for more information. This command corresponds to the
386           GetPrinterData() MS Platform SDK function.
387
388       getdataex
389           Get printer driver data with keyname
390
391       getdriver <printername>
392           Retrieve the printer driver information (such as driver file,
393           config file, dependent files, etc...) for the given printer. This
394           command corresponds to the GetPrinterDriver() MS Platform SDK
395           function. Currently info level 1, 2, and 3 are supported.
396
397       getdriverdir <arch>
398           Execute a GetPrinterDriverDirectory() RPC to retrieve the SMB share
399           name and subdirectory for storing printer driver files for a given
400           architecture. Possible values for arch are "Windows 4.0" (for
401           Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
402           Alpha_AXP", and "Windows NT R4000".
403
404       getprinter <printername>
405           Retrieve the current printer information. This command corresponds
406           to the GetPrinter() MS Platform SDK function.
407
408       getprintprocdir
409           Get print processor directory
410
411       openprinter <printername>
412           Execute an OpenPrinterEx() and ClosePrinter() RPC against a given
413           printer.
414
415       setdriver <printername> <drivername>
416           Execute a SetPrinter() command to update the printer driver
417           associated with an installed printer. The printer driver must
418           already be correctly installed on the print server.
419
420           See also the enumprinters and enumdrivers commands for obtaining a
421           list of of installed printers and drivers.
422
423       addform
424           Add form
425
426       setform
427           Set form
428
429       getform
430           Get form
431
432       deleteform
433           Delete form
434
435       enumforms
436           Enumerate form
437
438       setprinter
439           Set printer comment
440
441       setprinterdata
442           Set REG_SZ printer data
443
444       setprintername <printername> <newprintername>
445           Set printer name
446
447       rffpcnex
448           Rffpcnex test
449
450   NETLOGON
451       logonctrl2
452           Logon Control 2
453
454       logonctrl
455           Logon Control
456
457       samsync
458           Sam Synchronisation
459
460       samdeltas
461           Query Sam Deltas
462
463       samlogon
464           Sam Logon
465
466   GENERAL COMMANDS
467       debuglevel
468           Set the current debug level used to log information.
469
470       help (?)
471           Print a listing of all known commands or extended help on a
472           particular command.
473
474       quit (exit)
475           Exit rpcclient.
476

BUGS

478       rpcclient is designed as a developer testing tool and may not be robust
479       in certain areas (such as command line parsing). It has been known to
480       generate a core dump upon failures when invalid parameters where passed
481       to the interpreter.
482
483       From Luke Leighton´s original rpcclient man page:
484
485       WARNING!  The MSRPC over SMB code has been developed from examining
486       Network traces. No documentation is available from the original
487       creators (Microsoft) on how MSRPC over SMB works, or how the individual
488       MSRPC services work. Microsoft´s implementation of these services has
489       been demonstrated (and reported) to be... a bit flaky in places.
490
491       The development of Samba´s implementation is also a bit rough, and as
492       more of the services are understood, it can even result in versions of
493       smbd(8) and rpcclient(1) that are incompatible for some commands or
494       services. Additionally, the developers are sending reports to
495       Microsoft, and problems found or reported to Microsoft are fixed in
496       Service Packs, which may result in incompatibilities.
497

VERSION

499       This man page is correct for version 3 of the Samba suite.
500

AUTHOR

502       The original Samba software and related utilities were created by
503       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
504       Source project similar to the way the Linux kernel is developed.
505
506       The original rpcclient man page was written by Matthew Geddes, Luke
507       Kenneth Casson Leighton, and rewritten by Gerald Carter. The conversion
508       to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
509       DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
510
511
512
513Samba 3.5                         08/02/2011                      RPCCLIENT(1)
Impressum