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]
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 log
65           level 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       --option=<name>=<value>
84           Set the smb.conf(5) option "<name>" to value "<value>" from the
85           command line. This overrides compiled-in defaults and options read
86           from the configuration file.
87
88       -N|--no-pass
89           If specified, this parameter suppresses the normal password prompt
90           from the client to the user. This is useful when accessing a
91           service that does not require a password.
92
93           Unless a password is specified on the command line or this
94           parameter is specified, the client will request a password.
95
96           If a password is specified on the command line and this option is
97           also defined the password on the command line will be silently
98           ingnored and no password will be used.
99
100       -k|--kerberos
101           Try to authenticate with kerberos. Only useful in an Active
102           Directory environment.
103
104       -C|--use-ccache
105           Try to use the credentials cached by winbind.
106
107       -A|--authentication-file=filename
108           This option allows you to specify a file from which to read the
109           username and password used in the connection. The format of the
110           file is
111
112               username = <value>
113               password = <value>
114               domain   = <value>
115
116           Make certain that the permissions on the file restrict access from
117           unwanted users.
118
119       -U|--user=username[%password]
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 USER environment variable, then the
124           LOGNAME variable and if either exists, the string is uppercased. If
125           these environmental variables are not found, the username GUEST is
126           used.
127
128           A third option is to use a credentials file which contains the
129           plaintext of the username and password. This option is mainly
130           provided for scripts where the admin does not wish to pass the
131           credentials on the command line or via environment variables. If
132           this method is used, make certain that the permissions on the file
133           restrict access from unwanted users. See the -A for more details.
134
135           Be cautious about including passwords in scripts. Also, on many
136           systems the command line of a running process may be seen via the
137           ps command. To be safe always allow rpcclient to prompt for a
138           password and type it in directly.
139
140       -S|--signing on|off|required
141           Set the client signing state.
142
143       -P|--machine-pass
144           Use stored machine account password.
145
146       -e|--encrypt
147           This command line parameter requires the remote server support the
148           UNIX extensions or that the SMB3 protocol has been selected.
149           Requests that the connection be encrypted. Negotiates SMB
150           encryption using either SMB3 or POSIX extensions via GSSAPI. Uses
151           the given credentials for the encryption negotiation (either
152           kerberos or NTLMv1/v2 if given domain/username/password triple.
153           Fails the connection if encryption cannot be negotiated.
154
155       --pw-nt-hash
156           The supplied password is the NT hash.
157
158       -n|--netbiosname <primary NetBIOS name>
159           This option allows you to override the NetBIOS name that Samba uses
160           for itself. This is identical to setting the netbios name parameter
161           in the smb.conf file. However, a command line setting will take
162           precedence over settings in smb.conf.
163
164       -i|--scope <scope>
165           This specifies a NetBIOS scope that nmblookup will use to
166           communicate with when generating NetBIOS names. For details on the
167           use of NetBIOS scopes, see rfc1001.txt and rfc1002.txt. NetBIOS
168           scopes are very rarely used, only set this parameter if you are the
169           system administrator in charge of all the NetBIOS systems you
170           communicate with.
171
172       -W|--workgroup=domain
173           Set the SMB domain of the username. This overrides the default
174           domain which is the domain defined in smb.conf. If the domain
175           specified is the same as the servers NetBIOS name, it causes the
176           client to log on using the servers local SAM (as opposed to the
177           Domain SAM).
178
179       -O|--socket-options socket options
180           TCP socket options to set on the client socket. See the socket
181           options parameter in the smb.conf manual page for the list of valid
182           options.
183
184       -?|--help
185           Print a summary of command line options.
186
187       --usage
188           Display brief usage message.
189

COMMANDS

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

BUGS

529       rpcclient is designed as a developer testing tool and may not be robust
530       in certain areas (such as command line parsing). It has been known to
531       generate a core dump upon failures when invalid parameters where passed
532       to the interpreter.
533
534       From Luke Leighton´s original rpcclient man page:
535
536       WARNING!  The MSRPC over SMB code has been developed from examining
537       Network traces. No documentation is available from the original
538       creators (Microsoft) on how MSRPC over SMB works, or how the individual
539       MSRPC services work. Microsoft´s implementation of these services has
540       been demonstrated (and reported) to be... a bit flaky in places.
541
542       The development of Samba´s implementation is also a bit rough, and as
543       more of the services are understood, it can even result in versions of
544       smbd(8) and rpcclient(1) that are incompatible for some commands or
545       services. Additionally, the developers are sending reports to
546       Microsoft, and problems found or reported to Microsoft are fixed in
547       Service Packs, which may result in incompatibilities.
548

VERSION

550       This man page is correct for version 3 of the Samba suite.
551

AUTHOR

553       The original Samba software and related utilities were created by
554       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
555       Source project similar to the way the Linux kernel is developed.
556
557       The original rpcclient man page was written by Matthew Geddes, Luke
558       Kenneth Casson Leighton, and rewritten by Gerald Carter. The conversion
559       to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
560       DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
561
562
563
564Samba 4.2                         06/19/2018                      RPCCLIENT(1)
Impressum