# エンタープライズ管理コマンド

## 概要

KeeperコマンダーCLIのエンタープライズ管理コマンドは、管理者がエンタープライズレベルの設定を管理・構成するために利用できます。これらのコマンドで、ユーザー、ロール、チーム、ノード、コンプライアンスレポートの管理が行いやすくなり、組織全体の監督と統制を効率化できます。

## コマンド

このセクションでは次のコマンドを扱います。

1. [エンタープライズユーザー操作コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/enterprise-user-commands/README.md)
2. [エンタープライズノード操作コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/enterprise-node-commands/README.md)
3. [エンタープライズロール操作コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/enterprise-role-commands/README.md)
4. [エンタープライズチーム操作コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/enterprise-team-commands/README.md)
5. [エンタープライズ情報表示コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/enterprise-info-commands/README.md)
6. [ユーザー移行コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/transfer-user-commands/README.md)
7. [デバイス承認コマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/device-approve-commands/README.md)
8. [エンタープライズデータ同期コマンド](#enterprise-down)
9. [監査アラートコマンド](https://github.com/Keeper-Security/gitbook-jp-secrets-manager/blob/main/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands/enterprise-management-commands/audit-alert-commands/README.md)
10. [監査ログエクスポートコマンド](#audit-log)
11. [監査レポート実行コマンド](#audit-report)
12. [ユーザー作成コマンド](#create-user)

### エンタープライズデータ同期コマンド <a href="#enterprise-down" id="enterprise-down"></a>

エンタープライズデータをローカルキャッシュにダウンロードします。

<details>

<summary>DotNet CLI</summary>

**コマンド:** `enterprise-get-data`

**例:**

```sh
My Vault> enterprise-get-data
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** `public async Task Load()`

```csharp
public async Task Load()
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** `Sync-KeeperEnterprise`

**フラグ:**

```powershell
PS> Sync-KeeperEnterprise
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `enterprise-down`

**オプション**:

* `--reset` エンタープライズデータを再読み込みする

**例:**

```sh
My Vault> enterprise-down --reset
```

</details>

<details>

<summary>Python SDK</summary>

**機能:** enterprise\_loader.load()

```python
from keepersdk.enterprise import enterprise_loader

enterprise_loader = enterprise_loader.EnterpriseLoader(KeeperAuth)
enterprise_loader.load()
```

</details>

### 監査ログエクスポートコマンド <a href="#audit-log" id="audit-log"></a>

エンタープライズの監査ログをエクスポートして表示します。

<details>

<summary>DotNet CLI</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** 近日公開

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:** 近日公開

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `audit-log`

**パラメータ:**

* `--target` - 監査ログのエクスポート先: `json` (**必須**)
* `--record` - Keeperレコード名またはUID

**オプション**:

* `--anonymize` - メールとユーザー名を対応するエンタープライズユーザーIDに置き換えて監査ログを匿名化する。ユーザーが削除された場合、またはメールが変更された場合、そのエントリは削除済みユーザーとして表示される。
* `--shared-folder-uid` - フィルター: 共有フォルダUID。設定レコードの既存値を上書きし新しいフィールド値を設定する。繰り返し指定可。
* `--node-id` - フィルター: ノードID。設定レコードの既存値を上書きし新しいフィールド値を設定する。繰り返し指定可。
* `--days` - フィルター: イベントの最大経過日数。設定レコードの既存の"last\_event\_time"値を上書きする

**例:**

```bash
My vault> audit-log --target json --record "Audit Log Config" --days 30
```

</details>

<details>

<summary>Python SDK</summary>

非対応

</details>

### 監査レポート実行コマンド <a href="#audit-report" id="audit-report"></a>

監査証跡レポートを実行します。

<details>

<summary>DotNet CLI</summary>

**コマンド :** `audit-report [options]`

**オプション:**

* `--limit <number>` - 返すイベントの最大件数 (既定: 100)
* `--order <asc|desc>` - 並び順
* `--created <datetime>` - イベント作成日時でフィルター
* `--event-type <types>` - カンマ区切りの監査イベントタイプ
* `--username <users>` - イベント発生元のユーザー名
* `--to-username <user>` - イベント対象のユーザー名
* `--record-uid <uid>` - レコードUID
* `--shared-folder-uid <uid>` - 共有フォルダUID

**イベントタイプ:** よく使う監査イベントタイプの例:

* `login`
* `logout`
* `record_add`
* `record_update`
* `record_delete`

**日付形式:**

* 絶対指定: `YYYY-MM-DD` または `YYYY-MM-DD HH:MM:SS`
* 相対指定: `today`, `yesterday`, `last_7_days`, `last_30_days`, `last_90_days`

**例:**

```bash
# Recent events
audit-report --limit 50
audit-report --limit 100 --order desc

# Filter by user
audit-report --username user@example.com --limit 200
audit-report --to-username target@example.com
# Filter by event type
audit-report --event-type login,logout
audit-report --event-type record_add,record_update,record_delete --limit 500
```

</details>

<details>

<summary>DotNet SDK</summary>

**メソッド:** GetAvailableEvents()

```csharp
public static async Task<AuditEventType[]> GetAvailableEvents(this IAuthentication auth)
```

**例:**

```csharp
var auditEvents = await context.Enterprise.Auth.GetAvailableEvents();
```

</details>

<details>

<summary>PowerCommander</summary>

未実装

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `audit-report`

**オプション**:

* `--syntax-help` - ヘルプを表示する
* `--report-type` - レポートタイプ: `raw`, `dim`, `hour`, `day`, `week`, `month`, `span`
* `--report-format` - 出力形式 (rawレポートのみ): `message` (既定) または `fields`
* `--column` - 列名。繰り返し指定可。(rawレポートでは無視)
* `--aggregate` - 集計値。繰り返し指定可。(rawレポートでは無視): `occurrences`, `first_created`, `last_created`
* `--timezone` - 指定タイムゾーンで結果を返す
* `--limit` - 返す行の最大数 (rawのreport-typeでは-1ですべての行を取得)
* `--order` - 並び順: `desc` または `asc`
* `--created` - フィルター: 作成日。定義済み: `today`, `yesterday`, `last_7_days`, `last_30_days`, `month_to_date`, `last_month`, `year_to_date`, `last_year`
* `--event-type` - フィルター: 監査イベントタイプ。繰り返し指定可。
* `--username` - フィルター: イベント発生元のユーザー名。繰り返し指定可。
* `--to-username` - フィルター: イベント対象のユーザー名。繰り返し指定可。
* `--ip-address` - フィルター: IPアドレス。繰り返し指定可。
* `--record-uid` - フィルター: レコードUID。繰り返し指定可。
* `--shared-folder-uid` - フィルター: 共有フォルダUID。繰り返し指定可。
* `--geo-location` - フィルター: 地理位置情報
* `--device-type` - フィルター: デバイスタイプ
* `--format` - 出力形式: `json`, `table`, `csv`
* `--output` - 出力ファイル名

</details>

<details>

<summary>Python SDK</summary>

**機能:** execute\_audit\_report()

```bash
raw_report = audit_report.RawAuditReport(KeeperAuth)
raw_report.execute_audit_report()
```

</details>

#### レポートタイプ <a href="#report-types" id="report-types"></a>

* **raw**: 個別イベントを返す。すべてのイベントプロパティを返す。
* **dim**: イベントプロパティの説明またはユニークな値を返す。
* **hour/day/week/month**: 作成日で監査イベントを集計する。
* **span**: 日付集計なしで監査イベントを集計する。

### ユーザー作成コマンド <a href="#create-user" id="create-user"></a>

`create-user` コマンドは新しいエンタープライズユーザーを作成し、ノードに割り当て、指定フォルダに資格情報を保存できます。ワンタイムの安全な資格情報共有にも対応します。

<details>

<summary>DotNet CLI</summary>

**コマンド:**

**フラグ:**

```bash
```

</details>

<details>

<summary>DotNet SDK</summary>

**コマンド:**

**フラグ:**

```bash
```

</details>

<details>

<summary>PowerCommander</summary>

**コマンド:**

**フラグ:**

```bash
```

</details>

<details>

<summary>Python CLI</summary>

**コマンド**: `create-user email <Email>`

**エイリアス:** `ecu`

**パラメータ**:

`email` - ユーザーのメール (必須)

**オプション**:

* `--name`, `--full-name` - ユーザー名
* `--node` - ノード名またはノードID
* `--folder` - パスワードレコードを保存するフォルダ名またはUID
* `-v`, `--verbose` - 詳細情報を表示する

**例:**

```bash
My Vault> create-user user@example.com --name "John Doe" --node "Engineering"
```

</details>

<details>

<summary>Python SDK</summary>

**機能:** create\_user()

<pre class="language-python"><code class="lang-python">from keepersdk.enterprise.enterprise_user_management import (
    EnterpriseUserManager,
    CreateUserRequest,
    CreateUserResponse
)

CreateUserResponse response;
user_manager = EnterpriseUserManager(
        loader=context.enterprise_loader,
        auth_context=context.auth
    )
<strong>request = CreateUserRequest(
</strong>        email=email,
        display_name=display_name,
        node_name=node_name,
        node_id=node_id,
        password_length=password_length,
        suppress_email_invite=suppress_email_invite
    )
 response = user_manager.create_user(request)
</code></pre>

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/commander-sdk/keeper-commander-sdks/sdk-command-reference/enterprise-management-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
