Name

rpcclient — クライアント側の MS-RPC 関数を発行するツール

Synopsis

rpcclient [-A authfile] [-c <command string>] [-d debuglevel] [-h] [-l logdir] [-N] [-s <smb config file>] [-U username[%password]] [-W workgroup] [-N] [-I destinationIP] {server}

説明

このツールは samba(7) システムの一部である。

rpcclient は Samba の MS-RPC 機能をテストするために開発されたユーティリティであり、 開発と安定を何度か繰り返している。 多数のシステム管理者がこのツールを用いて UNIX ワークステーションから Windows NT クライアントを管理するスクリプトを作成している。

オプション

server

接続先のサーバを NetBIOS 名で指定する。 サーバは SMB/CIFS サーバである必要がある。 この名前の解決には smb.conf(5 ) ファイルの name resolve order パラメータが用いられる。

-c|--command='command string'

実行するコマンド (以下で記述) をセミコロンで区切って指定する。

-I IP-address

IP address は接続先の サーバのアドレスを指定する。記述方法は、標準的な "a.b.c.d" のフォーマットで指定する。

通常、クライアントは上記の name resolve order パラメータで指定された名前解決の機能を使用して NetBIOS 名を検索し、SMB/CIFS サーバを特定する。 このパラメータを使用することで、クライアントに対し強制的に 指定された IP Address にサーバがあると認識させ、接続しようとしているリソースの NetBIOS 名を無視させることができる。

このパラメータにデフォルトの値はない。 もしこの値が指定されていないのなら、上で述べたようにクライアントが 自動的に判別する。

-d|--debuglevel=level

level is an integer from 0 to 10. The default value if this parameter is not specified is 0.

The 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.

Levels 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.

Note that specifying this parameter here will override the parameter in the smb.conf file.

-V|--version

Prints the program version number.

-s|--configfile <configuration file>

The 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 smb.conf for more information. The default configuration file name is determined at compile time.

-l|--log-basename=logdirectory

Base directory name for log/debug files. The extension ".progname" will be appended (e.g. log.smbclient, log.smbd, etc...). The log file is never removed by the client.

-N|--no-pass

If 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.

Unless a password is specified on the command line or this parameter is specified, the client will request a password.

If 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.

-k|--kerberos

Try to authenticate with kerberos. Only useful in an Active Directory environment.

-C|--use-ccache

Try to use the credentials cached by winbind.

-A|--authentication-file=filename

This 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

username = <value>
password = <value>
domain   = <value>

Make certain that the permissions on the file restrict access from unwanted users.

-U|--user=username[%password]

Sets the SMB username or username and password.

If %password is not specified, the user will be prompted. The client will first check the USER environment variable, then the LOGNAME variable and if either exists, the string is uppercased. If these environmental variables are not found, the username GUEST is used.

A 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 -A for more details.

Be cautious about including passwords in scripts. Also, on many systems the command line of a running process may be seen via the ps command. To be safe always allow rpcclient to prompt for a password and type it in directly.

-n|--netbiosname <primary NetBIOS name>

This option allows you to override the NetBIOS name that Samba uses for itself. This is identical to setting the parameter in the smb.conf file. However, a command line setting will take precedence over settings in smb.conf.

-i|--scope <scope>

This specifies a NetBIOS scope that nmblookup will 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 very rarely used, only set this parameter if you are the system administrator in charge of all the NetBIOS systems you communicate with.

-W|--workgroup=domain

Set 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).

-O|--socket-options socket options

TCP socket options to set on the client socket. See the socket options parameter in the smb.conf manual page for the list of valid options.

-h|--help

Print a summary of command line options.

コマンド

SPOOLSS

adddriver <arch> <config> [<version>]

プリンタドライバ情報をサーバに登録するために AddPrinterDriver() RPC の呼び出しを行なう。ドライバファイルは getdriverdir コマンドが返却するディレクトリ中に予め存在している必要が ある。arch に設定できる値は getdriverdir コマンドで取得できる値と同じである。 config パラメータでは以下の形式のファイルを 指定する。

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

空のフィールドには、"NULL" という文字列を指定しておくこと。

Samba は Print Monitor 機能をサポートする必要がない。 これは、この機能が双方向通信を利用するドライバを使うローカルプリンタにしか関係しないためである。 このフィールドは必ず「NULL」にしておくこと。 遠隔の NT プリントサーバにコマンドを発行する場合、 ドライバの Print Monitor 機能をドライバの追加前にインストールしていないと、 RPC に失敗する。

version パラメータにより、プリンタドライバのバージョン番号が指定される。 省略した場合、アーキテクチャに応じたバージョンが用いられる。 このオプションは Windows 2000 (バージョン 3)のプリンタドライバのアップロードに用いることができる。

addprinter <printername> <sharename> <drivername> <port>

遠隔のサーバ上にプリンタを追加する。このプリンタは自動的に共有される。 このコマンドを実行する前に、プリンタドライバをサーバ上にインストール して (adddriver を参照のこと)、port を有効なポート名にしておく (enumports を参照) 必要があることに注意。

deldriver

指定されたプリンタドライバについて、すべてのアーキテクチャ用のものを削除する。これは、 ドライバのファイル自体をサーバから削除するわけではなく、 サーバのドライバのリストからエントリだけを削除するものである。

deldriverex <driver> [architecture] [version]

指定されたプリンタドライバについて、ドライバファイルも含めて削除する。 削除対象のバージョンやアーキテクチャを指定することも可能である。 アーキテクチャが指定されなかった場合、すべてのドライバファイルが削除される。

enumdata

サーバ上に格納されているプリンタの設定情報を一覧表示する。Windows NT クライアントの場合、 これらの情報はレジストリに格納されているが、Samba サーバの場合、 プリンタ用の TDB ファイル中に格納されている。このコマンドは、 Microsoft Platform SDK 中にある GetPrinterData() 関数に相当する。 (このコマンドは現在実装されていない)

enumdataex

キーに基づいたプリンタの情報を表示する。

enumjobs <printer>

指定されたプリンタのジョブおよびその状況を表示する。 このコマンドは、Microsoft Platform SDK 中の EnumJobs() 関数に相当する。

enumkey

プリンタキーを 一覧表示する。

enumports [level]

指定された info level でEnumPorts() 関数を呼び出す。現在、info level 1 と 2 のみがサポートされている。

enumdrivers [level]

EnumPrinterDrivers() を実行する。これは全てのアーキテクチャ用の インストールされたドライバの一覧を表示する。フラグとオプションの 詳細については、Microsoft Platform SDK のドキュメントを参照のこと。 現在、info level 1, 2, 3 のみがサポートされている。

enumprinters [level]

EnumPrinters() を実行する。これは共有されている インストール済プリンタの一覧を表示する。フラグとオプションの詳細に ついては、Microsoft Platform SDK のドキュメントを参照のこと。 現在、info level 1, 2, 5 のみがサポートされている。

getdata <printername> <valuename;>

指定されたプリンタの設定情報を取得する。 詳細な情報に付いては、enumdata コマンドを参照のこと。 このコマンドは Microsoft Platform SDK 中の GetPrinterData() に相当するものである。

getdataex

キー名に基づいた プリンタドライバのデータを取得する。

getdriver <printername>

指定されたプリンタのプリンタドライバの情報 (ドライバファイル、 設定ファイル、関連するファイルなど) を取得する。このコマンドは Microsoft Platform SDK 中の GetPrinterDriver() に相当するものである。 現在、info level 1, 2, 3 のみがサポートされている。

getdriverdir <arch>

GetPrinterDriverDirectory() RPC を発行して、SMB 共有名と指定された アーキテクチャ用のプリンタドライバの格納されているサブディレクトリを 取得する。arch に指定できる値は、 "Windows 4.0" (for Windows 95/98), "Windows NT x86", "Windows NT PowerPC", "Windows Alpha_AXP", "Windows NT R4000" である。

getprinter <printername>

現在のプリンタ情報を取得する。このコマンドは Microsoft Platform SDK の GetPrinter() に相当する。

getprintprocdir

print processor ディレクトリを取得する。

openprinter <printername>

指定したプリンタに対して、OpenPrinterEx() と ClosePrinter() RPC を実行する。

setdriver <printername> <drivername>

SetPrinter() コマンドを実行して、既にインストール されているプリンタ用のプリンタドライバを更新する。 更新されるプリンタドライバは、プリントサーバ上に適切にインストール されている必要がある。

インストールされているプリンタやドライバの一覧を取得する方法に ついては enumprintersenumdrivers コマンドも参照のこと。

addform

フォームを追加する。

setform

フォームを設定する。

getform

フォームを取得する。

deleteform

フォームを削除する。

enumforms

フォームを 一覧表示する。

setprinter

プリンタのコメントを 設定する。

setprinterdata

REG_SZ プリンタデータを設定する。

setprintername <printername> <newprintername>

プリンタ名を設定する。

rffpcnex

Rffpcnex テストを実行する。