source: branches/samba-3.5.x/docs/manpages/rpcclient.1@ 717

Last change on this file since 717 was 620, checked in by Herwig Bauernfeind, 14 years ago

Samba 3.5: Update trunk to 3.5.11

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