source: branches/samba-3.3.x/docs/manpages/rpcclient.1@ 368

Last change on this file since 368 was 368, checked in by Herwig Bauernfeind, 16 years ago

Update Samba 3.3 to 3.3.10 (docs)

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