source: branches/samba-3.2.x/docs/manpages/rpcclient.1@ 225

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

Update 3.2 branch to 3.2.6 docs manpages

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