source: vendor/3.6.23/docs/manpages/rpcclient.1

Last change on this file was 860, checked in by Silvan Scherrer, 11 years ago

Samba 3.6: updated vendor to latest version

File size: 17.4 KB
Line 
1'\" t
2.\" Title: rpcclient
3.\" Author: [see the "AUTHOR" section]
4.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5.\" Date: 09/18/2013
6.\" Manual: User Commands
7.\" Source: Samba 3.6
8.\" Language: English
9.\"
10.TH "RPCCLIENT" "1" "09/18/2013" "Samba 3\&.6" "User Commands"
11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31rpcclient \- tool for executing client side MS\-RPC functions
32.SH "SYNOPSIS"
33.HP \w'\ 'u
34rpcclient [\-A\ authfile] [\-c\ <command\ string>] [\-d\ debuglevel] [\-h] [\-l\ logdir] [\-N] [\-s\ <smb\ config\ file>] [\-U\ username[%password]] [\-W\ workgroup] [\-I\ destinationIP] {server}
35.SH "DESCRIPTION"
36.PP
37This tool is part of the
38\fBsamba\fR(7)
39suite\&.
40.PP
41rpcclient
42is a utility initially developed to test MS\-RPC functionality in Samba itself\&. It has undergone several stages of development and stability\&. Many system administrators have now written scripts around it to manage Windows NT clients from their UNIX workstation\&.
43.SH "OPTIONS"
44.PP
45server
46.RS 4
47NetBIOS name of Server to which to connect\&. The server can be any SMB/CIFS server\&. The name is resolved using the
48\m[blue]\fBname resolve order\fR\m[]
49line from
50\fBsmb.conf\fR(5)\&.
51.RE
52.PP
53\-c|\-\-command=<command string>
54.RS 4
55Execute semicolon separated commands (listed below)
56.RE
57.PP
58\-I|\-\-dest\-ip IP\-address
59.RS 4
60\fIIP address\fR
61is the address of the server to connect to\&. It should be specified in standard "a\&.b\&.c\&.d" notation\&.
62.sp
63Normally the client would attempt to locate a named SMB/CIFS server by looking it up via the NetBIOS name resolution mechanism described above in the
64\fIname resolve order\fR
65parameter above\&. Using this parameter will force the client to assume that the server is on the machine with the specified IP address and the NetBIOS name component of the resource being connected to will be ignored\&.
66.sp
67There is no default for this parameter\&. If not supplied, it will be determined automatically by the client as described above\&.
68.RE
69.PP
70\-p|\-\-port port
71.RS 4
72This number is the TCP port number that will be used when making connections to the server\&. The standard (well\-known) TCP port number for an SMB/CIFS server is 139, which is the default\&.
73.RE
74.PP
75\-d|\-\-debuglevel=level
76.RS 4
77\fIlevel\fR
78is an integer from 0 to 10\&. The default value if this parameter is not specified is 0\&.
79.sp
80The higher this value, the more detail will be logged to the log files about the activities of the server\&. At level 0, only critical errors and serious warnings will be logged\&. Level 1 is a reasonable level for day\-to\-day running \- it generates a small amount of information about operations carried out\&.
81.sp
82Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem\&. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic\&.
83.sp
84Note that specifying this parameter here will override the
85\m[blue]\fBlog level\fR\m[]
86parameter in the
87smb\&.conf
88file\&.
89.RE
90.PP
91\-V|\-\-version
92.RS 4
93Prints the program version number\&.
94.RE
95.PP
96\-s|\-\-configfile <configuration file>
97.RS 4
98The file specified contains the configuration details required by the server\&. The information in this file includes server\-specific information such as what printcap file to use, as well as descriptions of all the services that the server is to provide\&. See
99smb\&.conf
100for more information\&. The default configuration file name is determined at compile time\&.
101.RE
102.PP
103\-l|\-\-log\-basename=logdirectory
104.RS 4
105Base directory name for log/debug files\&. The extension
106\fB"\&.progname"\fR
107will be appended (e\&.g\&. log\&.smbclient, log\&.smbd, etc\&.\&.\&.)\&. The log file is never removed by the client\&.
108.RE
109.PP
110\-N|\-\-no\-pass
111.RS 4
112If specified, this parameter suppresses the normal password prompt from the client to the user\&. This is useful when accessing a service that does not require a password\&.
113.sp
114Unless a password is specified on the command line or this parameter is specified, the client will request a password\&.
115.sp
116If a password is specified on the command line and this option is also defined the password on the command line will be silently ingnored and no password will be used\&.
117.RE
118.PP
119\-k|\-\-kerberos
120.RS 4
121Try to authenticate with kerberos\&. Only useful in an Active Directory environment\&.
122.RE
123.PP
124\-C|\-\-use\-ccache
125.RS 4
126Try to use the credentials cached by winbind\&.
127.RE
128.PP
129\-A|\-\-authentication\-file=filename
130.RS 4
131This option allows you to specify a file from which to read the username and password used in the connection\&. The format of the file is
132.sp
133.if n \{\
134.RS 4
135.\}
136.nf
137username = <value>
138password = <value>
139domain = <value>
140.fi
141.if n \{\
142.RE
143.\}
144.sp
145Make certain that the permissions on the file restrict access from unwanted users\&.
146.RE
147.PP
148\-U|\-\-user=username[%password]
149.RS 4
150Sets the SMB username or username and password\&.
151.sp
152If %password is not specified, the user will be prompted\&. The client will first check the
153\fBUSER\fR
154environment variable, then the
155\fBLOGNAME\fR
156variable and if either exists, the string is uppercased\&. If these environmental variables are not found, the username
157\fBGUEST\fR
158is used\&.
159.sp
160A third option is to use a credentials file which contains the plaintext of the username and password\&. This option is mainly provided for scripts where the admin does not wish to pass the credentials on the command line or via environment variables\&. If this method is used, make certain that the permissions on the file restrict access from unwanted users\&. See the
161\fI\-A\fR
162for more details\&.
163.sp
164Be cautious about including passwords in scripts\&. Also, on many systems the command line of a running process may be seen via the
165ps
166command\&. To be safe always allow
167rpcclient
168to prompt for a password and type it in directly\&.
169.RE
170.PP
171\-n|\-\-netbiosname <primary NetBIOS name>
172.RS 4
173This option allows you to override the NetBIOS name that Samba uses for itself\&. This is identical to setting the
174\m[blue]\fBnetbios name\fR\m[]
175parameter in the
176smb\&.conf
177file\&. However, a command line setting will take precedence over settings in
178smb\&.conf\&.
179.RE
180.PP
181\-i|\-\-scope <scope>
182.RS 4
183This specifies a NetBIOS scope that
184nmblookup
185will use to communicate with when generating NetBIOS names\&. For details on the use of NetBIOS scopes, see rfc1001\&.txt and rfc1002\&.txt\&. NetBIOS scopes are
186\fIvery\fR
187rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with\&.
188.RE
189.PP
190\-W|\-\-workgroup=domain
191.RS 4
192Set the SMB domain of the username\&. This overrides the default domain which is the domain defined in smb\&.conf\&. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM)\&.
193.RE
194.PP
195\-O|\-\-socket\-options socket options
196.RS 4
197TCP socket options to set on the client socket\&. See the socket options parameter in the
198smb\&.conf
199manual page for the list of valid options\&.
200.RE
201.PP
202\-h|\-\-help
203.RS 4
204Print a summary of command line options\&.
205.RE
206.SH "COMMANDS"
207.SS "LSARPC"
208.PP
209lsaquery
210.RS 4
211Query info policy
212.RE
213.PP
214lookupsids
215.RS 4
216Resolve a list of SIDs to usernames\&.
217.RE
218.PP
219lookupnames
220.RS 4
221Resolve a list of usernames to SIDs\&.
222.RE
223.PP
224enumtrusts
225.RS 4
226Enumerate trusted domains
227.RE
228.PP
229enumprivs
230.RS 4
231Enumerate privileges
232.RE
233.PP
234getdispname
235.RS 4
236Get the privilege name
237.RE
238.PP
239lsaenumsid
240.RS 4
241Enumerate the LSA SIDS
242.RE
243.PP
244lsaenumprivsaccount
245.RS 4
246Enumerate the privileges of an SID
247.RE
248.PP
249lsaenumacctrights
250.RS 4
251Enumerate the rights of an SID
252.RE
253.PP
254lsaenumacctwithright
255.RS 4
256Enumerate accounts with a right
257.RE
258.PP
259lsaaddacctrights
260.RS 4
261Add rights to an account
262.RE
263.PP
264lsaremoveacctrights
265.RS 4
266Remove rights from an account
267.RE
268.PP
269lsalookupprivvalue
270.RS 4
271Get a privilege value given its name
272.RE
273.PP
274lsaquerysecobj
275.RS 4
276Query LSA security object
277.RE
278.SS "LSARPC\-DS"
279.PP
280dsroledominfo
281.RS 4
282Get Primary Domain Information
283.RE
284.PP
285.PP
286\fIDFS\fR
287.PP
288dfsexist
289.RS 4
290Query DFS support
291.RE
292.PP
293dfsadd
294.RS 4
295Add a DFS share
296.RE
297.PP
298dfsremove
299.RS 4
300Remove a DFS share
301.RE
302.PP
303dfsgetinfo
304.RS 4
305Query DFS share info
306.RE
307.PP
308dfsenum
309.RS 4
310Enumerate dfs shares
311.RE
312.SS "REG"
313.PP
314shutdown
315.RS 4
316Remote Shutdown
317.RE
318.PP
319abortshutdown
320.RS 4
321Abort Shutdown
322.RE
323.SS "SRVSVC"
324.PP
325srvinfo
326.RS 4
327Server query info
328.RE
329.PP
330netshareenum
331.RS 4
332Enumerate shares
333.RE
334.PP
335netfileenum
336.RS 4
337Enumerate open files
338.RE
339.PP
340netremotetod
341.RS 4
342Fetch remote time of day
343.RE
344.SS "SAMR"
345.PP
346queryuser
347.RS 4
348Query user info
349.RE
350.PP
351querygroup
352.RS 4
353Query group info
354.RE
355.PP
356queryusergroups
357.RS 4
358Query user groups
359.RE
360.PP
361querygroupmem
362.RS 4
363Query group membership
364.RE
365.PP
366queryaliasmem
367.RS 4
368Query alias membership
369.RE
370.PP
371querydispinfo
372.RS 4
373Query display info
374.RE
375.PP
376querydominfo
377.RS 4
378Query domain info
379.RE
380.PP
381enumdomusers
382.RS 4
383Enumerate domain users
384.RE
385.PP
386enumdomgroups
387.RS 4
388Enumerate domain groups
389.RE
390.PP
391enumalsgroups
392.RS 4
393Enumerate alias groups
394.RE
395.PP
396createdomuser
397.RS 4
398Create domain user
399.RE
400.PP
401samlookupnames
402.RS 4
403Look up names
404.RE
405.PP
406samlookuprids
407.RS 4
408Look up names
409.RE
410.PP
411deletedomuser
412.RS 4
413Delete domain user
414.RE
415.PP
416samquerysecobj
417.RS 4
418Query SAMR security object
419.RE
420.PP
421getdompwinfo
422.RS 4
423Retrieve domain password info
424.RE
425.PP
426lookupdomain
427.RS 4
428Look up domain
429.RE
430.SS "SPOOLSS"
431.PP
432adddriver <arch> <config> [<version>]
433.RS 4
434Execute an AddPrinterDriver() RPC to install the printer driver information on the server\&. Note that the driver files should already exist in the directory returned by
435getdriverdir\&. Possible values for
436\fIarch\fR
437are the same as those for the
438getdriverdir
439command\&. The
440\fIconfig\fR
441parameter is defined as follows:
442.sp
443.if n \{\
444.RS 4
445.\}
446.nf
447Long Printer Name:\e
448Driver File Name:\e
449Data File Name:\e
450Config File Name:\e
451Help File Name:\e
452Language Monitor Name:\e
453Default Data Type:\e
454Comma Separated list of Files
455.fi
456.if n \{\
457.RE
458.\}
459.sp
460Any empty fields should be enter as the string "NULL"\&.
461.sp
462Samba does not need to support the concept of Print Monitors since these only apply to local printers whose driver can make use of a bi\-directional link for communication\&. This field should be "NULL"\&. On a remote NT print server, the Print Monitor for a driver must already be installed prior to adding the driver or else the RPC will fail\&.
463.sp
464The
465\fIversion\fR
466parameter lets you specify the printer driver version number\&. If omitted, the default driver version for the specified architecture will be used\&. This option can be used to upload Windows 2000 (version 3) printer drivers\&.
467.RE
468.PP
469addprinter <printername> <sharename> <drivername> <port>
470.RS 4
471Add a printer on the remote server\&. This printer will be automatically shared\&. Be aware that the printer driver must already be installed on the server (see
472adddriver) and the
473\fIport\fRmust be a valid port name (see
474enumports\&.
475.RE
476.PP
477deldriver <driver>
478.RS 4
479Delete the specified printer driver for all architectures\&. This does not delete the actual driver files from the server, only the entry from the server\*(Aqs list of drivers\&.
480.RE
481.PP
482deldriverex <driver> [architecture] [version]
483.RS 4
484Delete the specified printer driver including driver files\&. You can limit this action to a specific architecture and a specific version\&. If no architecure is given, all driver files of that driver will be deleted\&.
485.RE
486.PP
487enumdata
488.RS 4
489Enumerate all printer setting data stored on the server\&. On Windows NT clients, these values are stored in the registry, while Samba servers store them in the printers TDB\&. This command corresponds to the MS Platform SDK GetPrinterData() function (* This command is currently unimplemented)\&.
490.RE
491.PP
492enumdataex
493.RS 4
494Enumerate printer data for a key
495.RE
496.PP
497enumjobs <printer>
498.RS 4
499List the jobs and status of a given printer\&. This command corresponds to the MS Platform SDK EnumJobs() function
500.RE
501.PP
502enumkey
503.RS 4
504Enumerate printer keys
505.RE
506.PP
507enumports [level]
508.RS 4
509Executes an EnumPorts() call using the specified info level\&. Currently only info levels 1 and 2 are supported\&.
510.RE
511.PP
512enumdrivers [level]
513.RS 4
514Execute an EnumPrinterDrivers() call\&. This lists the various installed printer drivers for all architectures\&. Refer to the MS Platform SDK documentation for more details of the various flags and calling options\&. Currently supported info levels are 1, 2, and 3\&.
515.RE
516.PP
517enumprinters [level]
518.RS 4
519Execute an EnumPrinters() call\&. This lists the various installed and share printers\&. Refer to the MS Platform SDK documentation for more details of the various flags and calling options\&. Currently supported info levels are 1, 2 and 5\&.
520.RE
521.PP
522getdata <printername> <valuename;>
523.RS 4
524Retrieve the data for a given printer setting\&. See the
525enumdata
526command for more information\&. This command corresponds to the GetPrinterData() MS Platform SDK function\&.
527.RE
528.PP
529getdataex
530.RS 4
531Get printer driver data with keyname
532.RE
533.PP
534getdriver <printername>
535.RS 4
536Retrieve the printer driver information (such as driver file, config file, dependent files, etc\&.\&.\&.) for the given printer\&. This command corresponds to the GetPrinterDriver() MS Platform SDK function\&. Currently info level 1, 2, and 3 are supported\&.
537.RE
538.PP
539getdriverdir <arch>
540.RS 4
541Execute a GetPrinterDriverDirectory() RPC to retrieve the SMB share name and subdirectory for storing printer driver files for a given architecture\&. Possible values for
542\fIarch\fR
543are "Windows 4\&.0" (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows Alpha_AXP", and "Windows NT R4000"\&.
544.RE
545.PP
546getprinter <printername>
547.RS 4
548Retrieve the current printer information\&. This command corresponds to the GetPrinter() MS Platform SDK function\&.
549.RE
550.PP
551getprintprocdir
552.RS 4
553Get print processor directory
554.RE
555.PP
556openprinter <printername>
557.RS 4
558Execute an OpenPrinterEx() and ClosePrinter() RPC against a given printer\&.
559.RE
560.PP
561setdriver <printername> <drivername>
562.RS 4
563Execute a SetPrinter() command to update the printer driver associated with an installed printer\&. The printer driver must already be correctly installed on the print server\&.
564.sp
565See also the
566enumprinters
567and
568enumdrivers
569commands for obtaining a list of of installed printers and drivers\&.
570.RE
571.PP
572addform
573.RS 4
574Add form
575.RE
576.PP
577setform
578.RS 4
579Set form
580.RE
581.PP
582getform
583.RS 4
584Get form
585.RE
586.PP
587deleteform
588.RS 4
589Delete form
590.RE
591.PP
592enumforms
593.RS 4
594Enumerate form
595.RE
596.PP
597setprinter
598.RS 4
599Set printer comment
600.RE
601.PP
602setprinterdata
603.RS 4
604Set REG_SZ printer data
605.RE
606.PP
607setprintername <printername> <newprintername>
608.RS 4
609Set printer name
610.RE
611.PP
612rffpcnex
613.RS 4
614Rffpcnex test
615.RE
616.SS "NETLOGON"
617.PP
618logonctrl2
619.RS 4
620Logon Control 2
621.RE
622.PP
623logonctrl
624.RS 4
625Logon Control
626.RE
627.PP
628samsync
629.RS 4
630Sam Synchronisation
631.RE
632.PP
633samdeltas
634.RS 4
635Query Sam Deltas
636.RE
637.PP
638samlogon
639.RS 4
640Sam Logon
641.RE
642.SS "GENERAL COMMANDS"
643.PP
644debuglevel
645.RS 4
646Set the current debug level used to log information\&.
647.RE
648.PP
649help (?)
650.RS 4
651Print a listing of all known commands or extended help on a particular command\&.
652.RE
653.PP
654quit (exit)
655.RS 4
656Exit
657rpcclient\&.
658.RE
659.SH "BUGS"
660.PP
661rpcclient
662is designed as a developer testing tool and may not be robust in certain areas (such as command line parsing)\&. It has been known to generate a core dump upon failures when invalid parameters where passed to the interpreter\&.
663.PP
664From Luke Leighton\*(Aqs original rpcclient man page:
665.PP
666\fIWARNING!\fR
667The MSRPC over SMB code has been developed from examining Network traces\&. No documentation is available from the original creators (Microsoft) on how MSRPC over SMB works, or how the individual MSRPC services work\&. Microsoft\*(Aqs implementation of these services has been demonstrated (and reported) to be\&.\&.\&. a bit flaky in places\&.
668.PP
669The development of Samba\*(Aqs implementation is also a bit rough, and as more of the services are understood, it can even result in versions of
670\fBsmbd\fR(8)
671and
672\fBrpcclient\fR(1)
673that are incompatible for some commands or services\&. Additionally, the developers are sending reports to Microsoft, and problems found or reported to Microsoft are fixed in Service Packs, which may result in incompatibilities\&.
674.SH "VERSION"
675.PP
676This man page is correct for version 3 of the Samba suite\&.
677.SH "AUTHOR"
678.PP
679The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
680.PP
681The original rpcclient man page was written by Matthew Geddes, Luke Kenneth Casson Leighton, and rewritten by Gerald Carter\&. The conversion to DocBook for Samba 2\&.2 was done by Gerald Carter\&. The conversion to DocBook XML 4\&.2 for Samba 3\&.0 was done by Alexander Bokovoy\&.
Note: See TracBrowser for help on using the repository browser.