preparing for release of 2.2.0-alpha2
[Samba/ekacnet.git] / docs / manpages / rpcclient.8
blob32326a1a8a5306cb357b8aff56d34a131b97be3d
1 .TH RPCCLIENT 8 "30 Jan 2001" "rpcclient 2.2.0-alpha2"
2 .SH "NAME" 
3 rpcclient \- developer\'s tool to testing client side MS-RPC functions
4 .SH "SYNOPSIS" 
5 .IP "\fBrpcclient\fP" 
6 [-d debuglevel] [-S server] [-l logbasename] [-n netbios name] [-N]
7 [-m maxprotocol] [-I destIP] [-E] [-U username] [-W workgroup] [-c `command string`]
8 [-t terminalcode] [-i scope] [-O socket options]
9 [-s smb\&.conf]
10 .SH "DESCRIPTION" 
11 .IP "\fBrpcclient\fP" 
12 is a utility for developers for executing various MS-RPC functions\&.  It\'s
13 primary use is for testing Samba\'s own MS-RPC server implementation, however
14 many administrators have written scripts around it to manage Windows NT clients
15 from their UNIX workstation\&.
16 .SH "OPTIONS" 
17 .PP 
18 .IP 
19 .IP "\fB-d debuglevel\fP" 
20 set the debuglevel\&. Debug level 0 is the lowest and 100 being the
21 highest\&. This should be set to 100 if you are planning on 
22 submitting a bug report to the Samba team (see BUGS\&.txt)\&.
23 .IP 
24 .IP "\fB-S server\fP" 
25 NetBIOS name of Server to which you wish to connect\&. The server can be 
26 any SMB/CIFS server\&. The name is resolved using either the "name resolve 
27 order = " line or by using the \fB-R\fP option\&.
28 .IP 
29 .IP "\fB-l logbasename\fP" 
30 File name for log/debug files\&. \&.client will be
31 appended\&. The log file is never removed  by the client\&.
32 .IP 
33 .IP "\fB-n netbios name\fP" 
34 NetBIOS name of the local machine\&. This option
35 is only needed if your Samba client cannot find
36 it automatically\&. Samba should use the uppercase of the machine\'s
37 hostname\&.
38 .IP 
39 .IP "\fB-N\fP" 
40 tells rpcclient not to ask for a password\&. rpcclient will prompt
41 the user by default\&.
42 .IP 
43 .IP "\fB-I destIP\fP" 
44 The IP address of the server specified with the \fB-S\fP
45 option\&. Only needed when the server\'s NetBIOS
46 name cannot be resolved using WINS or broadcast
47 and isn\'t found in the LMHOSTS file\&.
48 .IP 
49 .IP "\fB-E\fP" 
50 causes regedit to write messages to stderr instead of stdout\&.
51 .IP 
52 .IP "\fB-U username[%pass]\fP" 
53 Sets the SMB username or username and password\&. If %pass is not
54 specified, The user will be prompted\&. The client will first check the USER
55 environment variable, then the LOGNAME variable and if either exist, the
56 string is uppercased\&. Anything in these variables following a % sign will be
57 treated as the password\&. If these environmental variables are not found, the
58 username GUEST is used\&.
59 .IP 
60 If the password is not included in these environment variables
61 (using the %pass syntax), rpcclient will look for a PASSWD environment
62 variable from which to read the password\&.
63 .IP 
64 A third option is to use a credentials file which contains
65 the plaintext of the username and password\&.  This option is
66 mainly provided for scripts where the admin doesn\'t desire to
67 pass the credentials on the command line or via environment variables\&.
68 If this method is used, make certain that the permissions on the file
69 restrict access from unwanted users\&.  See the \fB-A\fP for more details\&.
70 .IP 
71 Be cautious about including passwords in scripts or in the
72 \f(CWPASSWD\fP environment variable\&. Also, on many systems the command
73 line of a running process may be seen via the \f(CWps\fP command to be
74 safe always allow smbclient to prompt for a password and type it in
75 directly\&.
76 .IP 
77 .IP "\fB-A <filename>\fP" 
78 This option allows you to specify a file from which
79 to read the username and password used in the connection\&.  The format
80 of the file is
81 .IP 
82 \f(CWusername = <value>\fP 
83 .br 
84 \f(CWpassword = <value>\fP 
85 .br 
86 .IP 
87 Make certain that the permissions on the file restrict access from
88 unwanted users\&.
89 .IP 
90 .IP "\fB-W domain\fP" 
91 Set the SMB domain of the username\&.   This overrides the default 
92 domain which is the domain of the server specified with the 
93 bt(-S) option\&. If the domain specified is the same as the server\'s
94 NetBIOS name, it causes the client to log on using the 
95 server\'s local SAM (as opposed to the Domain SAM)\&.
96 .IP 
97 .IP "\fB-P\fP" 
98 operate in promptless mode\&.  Without this mode (the default)
99 rpcclient displays a prompt of the form \'[domain\eusername@host]$\'
100 .IP 
101 .IP "\fB-c \'command string\'\fP" 
102 execute semicolon separated commands (listed below))
103 .IP 
104 .IP "\fB-t terminalcode\fP" 
105 This tells the Samba client how to interpret the incoming filenames, in regards
106 to character sets\&. The list here is not complete\&. For a complete list see your
107 local Samba source\&. Some valid options are sjis, euc, jis7, jis8, junet and hex\&.
108 .IP 
109 .IP "\fB-O socket options\fP" 
110 These socket options are the same as in smb\&.conf (under the bt(socket options = )
111 section)\&.
112 .IP 
113 .IP "\fB-s smb\&.conf\fP" 
114 Specifies the location of the all important smb\&.conf file\&.
115 .IP 
116 .IP "\fB-i scope\fP" 
117 Defines the NetBIOS scope\&. For more information on NetBIOS scopes, see rfc1001
118 and rfc1002\&. NetBIOS scopes are rarely used\&.
119 .IP 
120 .PP 
121 .SH "COMMANDS" 
122 .PP 
123 .IP "\fBSPOOLSS Commands\fP" 
124 .IP "spoolenum" 
125 Execute an EnumPrinters call\&.  This lists the various
126 installed and share printers\&.  Refer to the MS Platform
127 SDK documentation for more details of the various 
128 flags and calling options\&.
129 .PP 
130 .IP "spoolenumports <level>" 
131 Executes an EnumPorts call using the specified info level\&.
132 Currently only info level 1 and 2 are supported\&.
133 .PP 
134 .IP "spoolenumdata" 
135 Enumerate all printer setting data stored on the server\&.
136 On Windows NT  clients, these values are stored 
137 in the registry, while Samba servers store them in the printers
138 TDB\&.  This command corresponds to the MS Platform SDK EnumPorts 
139 function\&.
140 .PP 
141 .IP "spooljobs <printer>" 
142 List the jobs and status of a given printer\&.  This command
143 corresponds to the MS Platform SDK EnumJobs function\&.
144 .PP 
145 .IP "spoolopen <printer>" 
146 Execute an OpenPrinterEx() and ClosePrinter()
147 RPC against a given printer\&.
148 .PP 
149 .IP "spoolgetdata" 
150 Retrive the data for a given printer setting\&.  See the 
151 \fBspoolenumdata\fP command for more information\&.  This command
152 corresponds to the GetPrinterData() MS Platform SDK function\&.
153 .PP 
154 .IP "spoolgetprinter <printer>" 
155 Retrieve the current printer information\&.  This command
156 sorresponds to the GetPrinter() MS Platform SDK function\&.
157 .PP 
158 .IP "spoolgetprinterdriver <printer>" 
159 Retrive the printer driver information (such as driver file,
160 config file, dependent files, etc\&.\&.\&.) for the given printer\&.
161 This command corresponds to the GetPrinterDriver() MS Platform 
162 SDK function\&.
163 .PP 
164 .IP "spoolgetprinterdriverdir <arch>" 
165 Execute a GetPrinterDriverDirectory() RPC to retreive the
166 SMB share name and subdirectory for storing printer driver
167 files for a given architecture\&.  Possible values for <arch> are
168 "Windows 4\&.0" (for Windows 95/98), "Windows NT x86", "Windows NT
169 PowerPC", "Windows Alpha_AXP", and "Windows NT R4000"\&.
170 .PP 
171 .YODLTAGSTART. roffcmd .IP "spooladdprinter <printername> <sharename> 
172 <drivername> <port>" .YODLTAGEND. 
173 Add a printer on the remote server\&.  This printer will be automatically
174 shared\&.  Be aware that the printer driver must already be installed
175 on the server (see \fBaddprinterdriver\fP) and the <port> must
176 be a valid port name\&.
177 .PP 
178 .IP "spooladdprinterdriver <arch> <config>" 
179 Execute an AddPrinterDriver() RPC to install the printer 
180 driver information on the server\&.  Note that the driver files
181 should already exist in the directort returned by 
182 \fBspoolgetprinterdriverdir\fP\&.  Possible values for <arch>
183 are the same as those for the \fBspooolgetprintedriverdir\fP command\&.
184 The <config> parameter is defined as follows:
185 .PP 
186 .IP "" 
187 <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>
188 .PP 
189 .IP "" 
190 Any empty fields should be enter as the string "NULL"\&.
191 .PP 
192 .IP "" 
193 Samba does not need to support the concept of Print Monitors
194 since these only apply to local printers whose driver can make use
195 of a bi-directional link for communication\&.  This field should
196 be "NULL"\&.  On a remote NT print server, the Print Monitor for a driver
197 must already be installed prior to adding the driver or else the RPC
198 will fail\&.
199 .PP 
200 .IP "\fBGeneral Commands\fP" 
201 .IP "set" 
202 Set miscellaneous rpcclient command line options during a running 
203 session\&.
204 .PP 
205 .IP "use" 
206 Connect to a rmeote SMB server\&.  \fBrpcclient\fP has the ability
207 to maintain connections to multiple server simulaneously\&.
208 .PP 
209 .IP "help" 
210 Print a listing of all known commands or extended help 
211 on a particular command\&.
212 .PP 
213 .IP "quit" 
214 Exit rpcclient\&.
215 .PP 
216 .SH "BUGS" 
217 rpcclient is designed as a developer testing tool and may not be robust
218 in certain areas (such as command line parsing)\&.  It has been known to 
219 generate a core dump upon failures when invalid parameters where
220 passed to the interpreter\&.
221 .PP 
222 From Luke Leighton\'s original rpcclient man page:
223 "WARNING! The MSRPC over SMB code has been developed from examining 
224 Network traces\&. No documentation is available from the original creators 
225 (Microsoft) on how MSRPC over SMB works, or how the individual MSRPC services 
226 work\&. Microsoft\'s implementation of these services has been demonstrated 
227 (and reported) to be\&.\&.\&. a bit flakey in places\&.
228 .PP 
229 The development of Samba\'s implementation is also a bit rough, and as more 
230 of the services are understood, it can even result in versions of 
231 \fBsmbd(8)\fP and rpcclient that are incompatible for some commands or 
232 services\&. Additionally, the developers are sending reports to Microsoft, 
233 and problems found or reported to Microsoft are fixed in Service Packs, 
234 which may result in incompatibilities\&."
235 .PP 
236 .SH "SEE ALSO" 
237 \fBsamba (7)\fP
238 .SH "AUTHOR" 
239 Samba is written by The Samba Team as Open Source\&. This man page was written
240 by Matthew Geddes, Luke Kenneth Casson, and Gerald Carter\&.