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

COMMANDS

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

BUGS

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

VERSION

496       This man page is correct for version 3.0 of the Samba suite.
497

AUTHOR

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