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       netshareenumall
270           Enumerate all shares
271
272       netsharegetinfo
273           Get Share Info
274
275       netsharesetinfo
276           Set Share Info
277
278       netsharesetdfsflags
279           Set DFS flags
280
281       netfileenum
282           Enumerate open files
283
284       netremotetod
285           Fetch remote time of day
286
287       netnamevalidate
288           Validate sharename
289
290       netfilegetsec
291           Get File security
292
293       netsessdel
294           Delete Session
295
296       netsessenum
297           Enumerate Sessions
298
299       netdiskenum
300           Enumerate Disks
301
302       netconnenum
303           Enumerate Connections
304
305       netshareadd
306           Add share
307
308       netsharedel
309           Delete share
310
311   SAMR
312       queryuser
313           Query user info
314
315       querygroup
316           Query group info
317
318       queryusergroups
319           Query user groups
320
321       querygroupmem
322           Query group membership
323
324       queryaliasmem
325           Query alias membership
326
327       querydispinfo
328           Query display info
329
330       querydominfo
331           Query domain info
332
333       enumdomusers
334           Enumerate domain users
335
336       enumdomgroups
337           Enumerate domain groups
338
339       enumalsgroups
340           Enumerate alias groups
341
342       createdomuser
343           Create domain user
344
345       samlookupnames
346           Look up names
347
348       samlookuprids
349           Look up names
350
351       deletedomuser
352           Delete domain user
353
354       samquerysecobj
355           Query SAMR security object
356
357       getdompwinfo
358           Retrieve domain password info
359
360       lookupdomain
361           Look up domain
362
363   SPOOLSS
364       adddriver <arch> <config> [<version>]
365           Execute an AddPrinterDriver() RPC to install the printer driver
366           information on the server. Note that the driver files should
367           already exist in the directory returned by getdriverdir. Possible
368           values for arch are the same as those for the getdriverdir command.
369           The config parameter is defined as follows:
370
371               Long Driver Name:\
372               Driver File Name:\
373               Data File Name:\
374               Config File Name:\
375               Help File Name:\
376               Language Monitor Name:\
377               Default Data Type:\
378               Comma Separated list of Files
379
380           Any empty fields should be enter as the string "NULL".
381
382           Samba does not need to support the concept of Print Monitors since
383           these only apply to local printers whose driver can make use of a
384           bi-directional link for communication. This field should be "NULL".
385           On a remote NT print server, the Print Monitor for a driver must
386           already be installed prior to adding the driver or else the RPC
387           will fail.
388
389           The version parameter lets you specify the printer driver version
390           number. If omitted, the default driver version for the specified
391           architecture will be used. This option can be used to upload
392           Windows 2000 (version 3) printer drivers.
393
394       addprinter <printername> <sharename> <drivername> <port>
395           Add a printer on the remote server. This printer will be
396           automatically shared. Be aware that the printer driver must already
397           be installed on the server (see adddriver) and the portmust be a
398           valid port name (see enumports.
399
400       deldriver <driver>
401           Delete the specified printer driver for all architectures. This
402           does not delete the actual driver files from the server, only the
403           entry from the server's list of drivers.
404
405       deldriverex <driver> [architecture] [version] [flags]
406           Delete the specified printer driver and optionally files associated
407           with the driver. You can limit this action to a specific
408           architecture and a specific version. If no architecture is given,
409           all driver files of that driver will be deleted.  flags correspond
410           to numeric DPD_* values, i.e. a value of 3 requests
411           (DPD_DELETE_UNUSED_FILES | DPD_DELETE_SPECIFIC_VERSION).
412
413       enumdata
414           Enumerate all printer setting data stored on the server. On Windows
415           NT clients, these values are stored in the registry, while Samba
416           servers store them in the printers TDB. This command corresponds to
417           the MS Platform SDK GetPrinterData() function (* This command is
418           currently unimplemented).
419
420       enumdataex
421           Enumerate printer data for a key
422
423       enumjobs <printer>
424           List the jobs and status of a given printer. This command
425           corresponds to the MS Platform SDK EnumJobs() function
426
427       enumkey
428           Enumerate printer keys
429
430       enumports [level]
431           Executes an EnumPorts() call using the specified info level.
432           Currently only info levels 1 and 2 are supported.
433
434       enumdrivers [level]
435           Execute an EnumPrinterDrivers() call. This lists the various
436           installed printer drivers for all architectures. Refer to the MS
437           Platform SDK documentation for more details of the various flags
438           and calling options. Currently supported info levels are 1, 2, and
439           3.
440
441       enumprinters [level]
442           Execute an EnumPrinters() call. This lists the various installed
443           and share printers. Refer to the MS Platform SDK documentation for
444           more details of the various flags and calling options. Currently
445           supported info levels are 1, 2 and 5.
446
447       getdata <printername> <valuename;>
448           Retrieve the data for a given printer setting. See the enumdata
449           command for more information. This command corresponds to the
450           GetPrinterData() MS Platform SDK function.
451
452       getdataex
453           Get printer driver data with keyname
454
455       getdriver <printername>
456           Retrieve the printer driver information (such as driver file,
457           config file, dependent files, etc...) for the given printer. This
458           command corresponds to the GetPrinterDriver() MS Platform SDK
459           function. Currently info level 1, 2, and 3 are supported.
460
461       getdriverdir <arch>
462           Execute a GetPrinterDriverDirectory() RPC to retrieve the SMB share
463           name and subdirectory for storing printer driver files for a given
464           architecture. Possible values for arch are "Windows 4.0" (for
465           Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows
466           Alpha_AXP", and "Windows NT R4000".
467
468       getprinter <printername>
469           Retrieve the current printer information. This command corresponds
470           to the GetPrinter() MS Platform SDK function.
471
472       getprintprocdir
473           Get print processor directory
474
475       openprinter <printername>
476           Execute an OpenPrinterEx() and ClosePrinter() RPC against a given
477           printer.
478
479       setdriver <printername> <drivername>
480           Execute a SetPrinter() command to update the printer driver
481           associated with an installed printer. The printer driver must
482           already be correctly installed on the print server.
483
484           See also the enumprinters and enumdrivers commands for obtaining a
485           list of of installed printers and drivers.
486
487       addform
488           Add form
489
490       setform
491           Set form
492
493       getform
494           Get form
495
496       deleteform
497           Delete form
498
499       enumforms
500           Enumerate form
501
502       setprinter
503           Set printer comment
504
505       setprinterdata
506           Set REG_SZ printer data
507
508       setprintername <printername> <newprintername>
509           Set printer name
510
511       rffpcnex
512           Rffpcnex test
513
514   NETLOGON
515       logonctrl2
516           Logon Control 2
517
518       logonctrl
519           Logon Control
520
521       samsync
522           Sam Synchronisation
523
524       samdeltas
525           Query Sam Deltas
526
527       samlogon
528           Sam Logon
529
530   FSRVP
531       fss_is_path_sup <share>
532           Check whether a share supports shadow-copy requests
533
534       fss_get_sup_version
535           Get supported FSRVP version from server
536
537       fss_create_expose <context> <[ro|rw]> <share1> [share2] ... [shareN]
538           Request shadow-copy creation and exposure as a new share
539
540       fss_delete <base_share> <shadow_copy_set_id> <shadow_copy_id>
541           Request shadow-copy share deletion
542
543       fss_has_shadow_copy <base_share>
544           Check for an associated share shadow-copy
545
546       fss_get_mapping <base_share> <shadow_copy_set_id> <shadow_copy_id>
547           Get shadow-copy share mapping information
548
549       fss_recovery_complete <shadow_copy_set_id>
550           Flag read-write shadow-copy as recovery complete, allowing further
551           shadow-copy requests
552
553   GENERAL COMMANDS
554       debuglevel
555           Set the current debug level used to log information.
556
557       help (?)
558           Print a listing of all known commands or extended help on a
559           particular command.
560
561       quit (exit)
562           Exit rpcclient.
563

BUGS

565       rpcclient is designed as a developer testing tool and may not be robust
566       in certain areas (such as command line parsing). It has been known to
567       generate a core dump upon failures when invalid parameters where passed
568       to the interpreter.
569
570       From Luke Leighton's original rpcclient man page:
571
572       WARNING!  The MSRPC over SMB code has been developed from examining
573       Network traces. No documentation is available from the original
574       creators (Microsoft) on how MSRPC over SMB works, or how the individual
575       MSRPC services work. Microsoft's implementation of these services has
576       been demonstrated (and reported) to be... a bit flaky in places.
577
578       The development of Samba's implementation is also a bit rough, and as
579       more of the services are understood, it can even result in versions of
580       smbd(8) and rpcclient(1) that are incompatible for some commands or
581       services. Additionally, the developers are sending reports to
582       Microsoft, and problems found or reported to Microsoft are fixed in
583       Service Packs, which may result in incompatibilities.
584

VERSION

586       This man page is part of version 4.10.4 of the Samba suite.
587

AUTHOR

589       The original Samba software and related utilities were created by
590       Andrew Tridgell. Samba is now developed by the Samba Team as an Open
591       Source project similar to the way the Linux kernel is developed.
592
593       The original rpcclient man page was written by Matthew Geddes, Luke
594       Kenneth Casson Leighton, and rewritten by Gerald Carter. The conversion
595       to DocBook for Samba 2.2 was done by Gerald Carter. The conversion to
596       DocBook XML 4.2 for Samba 3.0 was done by Alexander Bokovoy.
597
598
599
600Samba 4.10.4                      05/28/2019                      RPCCLIENT(1)
Impressum