Find コマンド
find コマンドは、オブジェクトのセットを検索して、XML 表現を返します。
コマンド構文
api.sh|api.bat-u|--user ユーザー -p|--password パスワード [-H|--host ホスト] [-P|--port ポート] [-T|--truststorefile] find [--depth 奥行き] [--indent スペース数] [-o|--outfile ローカル・ファイルから書き込み先へ [-x --maxfilesize サイズ]] [-s --suppress 抑止するクラスのリスト (list-of-classes-to-suppress)] ルート
api.sh|api.bat-u|--user ユーザー -p|--password パスワード [-H|--host ホスト] [-P|--port ポート] [-T|--truststorefile] find [--depth 奥行き] [--indent スペース数] --guid オブジェクト GUID
api.sh|api.bat -u|--user ユーザー -p|--password パスワード [-H|--host ホスト] [-P|--port ポート] [-T|--truststorefile] find [--depth 奥行き] [--indent スペース数] [--changetype タイプ --from 開始日 [--end 終了日]] ルート
api.sh|api.bat -u|--user ユーザー -p|--password パスワード [-H|--host ホスト] [-P|--port ポート] [-T|--truststorefile] find [--depth 奥行き] [--indent スペース数] [--mssguid MS-GUID|--mssname mss-名前] mql-照会
api.sh|api.bat -u|--user ユーザー -p|--password パスワード [-H|--host ホスト] [-P|--port ポート] [-T|--truststorefile] find --count mql-照会
パラメーター
- find
- find コマンドを実行します。
- --depth depth
- 構成する結果ツリーのレベル。
- --indent num spaces
- 生成される XML 出力に使用するインデント。
- --changetype type
変更のタイプ。値は以下のいずれかです。
- 0
- 作成
- 1
- 更新
- 2
- 削除
- 3
- 作成および更新
- 4
- すべての変更
- --from from-date
- change パラメーターの開始日。 mm/dd/yy hh:mm:ss AM|PM 形式を使用します。
- --end end-date
- change パラメーターの終了日。 mm/dd/yy hh:mm:ss AM|PM 形式を使用します。
- -o|--outfile local-file-to-write-to
- find コマンドの出力のリダイレクト先のファイルの名前。
- -x|--maxfilesize size
- 最大ファイル・サイズ (バイト単位) を指定することにより、出力ファイルを複数の小さいサイズのファイルにまとめます。 可能な場合は、出力が、最大ファイル・サイズ以下の複数のファイルに分割されます。
- -s|--suppress list-of-classes-to-suppress
- 検索結果から除外するクラスのリスト。 クラスは、ComputerSystem や OperatingSystem などのモデル・オブジェクト名クラスです。
- --guid object-guid
- find コマンドの実行対象となるオブジェクトの GUID。
- --mssguid mss-guid|--mssname mss-name
- 管理ソフトウェア・システムの GUID または名前。
- --count mql-query
- MQL 照会を満たすオブジェクトの数を返します。
- mql 照会
- モデル照会言語 (MQL) を使用して指定された照会。例えば、SELECT attributes FROM object type [WHERE expression]。 この引数のオブジェクト・タイプには、長い名前または短縮名を使用できます。 クラス名および MQL 照会について詳しくは、関連概念を参照してください。
- ルート
- 結果の XML 出力のルートとなるモデル・オブジェクト。 この引数のオブジェクト・タイプには、長い名前または短縮名を使用できます。 クラス名について詳しくは、関連概念を参照してください。
例
- 以下のコマンドは、コンピューター・システムを検索して、その結果を最大ファイル・サイズが 1000 バイトの cs_output.xml ファイルに保存します。
api.sh -u user -p password -H host -P port find -o cs_output.xml -x 1000 ComputerSystem - 以下のコマンドは、データベース内にある ComputerSystem オブジェクトの数を数えます。
api.sh -u user -p password find --count "select * from ComputerSystem" - このコマンドでは、検索の深さが定義したレベルまでに制限されます。 結果は cs_output.xml ファイルに保存されます。
api.sh -u user -p password -H host -P port find --depth depth -o cs_output.xml ComputerSystem