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