> For the complete documentation index, see [llms.txt](https://docs.keeper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands/creating-and-inviting-users.md).

# ユーザーの作成と招待

## 概要

コマンダーでユーザーアカウントを作成する方法は、主に以下の2つです。

* `enterprise-user --add` コマンドでユーザーを企業に招待
* `create-user` コマンドでユーザーアカウントとボルトを新規作成

このページでは、各方法の使い方を取り扱います。

### どの方法を使用すべきか

多くの場合、`enterprise-user --add` で新規ユーザーを招待する方法が最適です。新規ユーザーのメールアドレスに、ボルト作成手順が送信されます。

`create-user` は、管理者が新規ボルトにすぐにアクセスする必要がある場合や、レコードを新規ボルトですぐに共有する必要がある場合など、特殊な状況で有用です。

MFAまたはSSOログインを必須とする企業で `create-user` を使用する場合、各新規ユーザーに対応するクレデンシャルを用意する必要があります。

## ユーザーを企業に招待する

コマンダーを使用し、メールアドレスでユーザーを企業に招待できます。

ユーザーを企業に招待するには、`enterprise-user` コマンドに `--add` フラグを指定します。

#### 形式:

```
enterprise-user John_Smith@example.com --add
```

招待するユーザーの表示名は、`--name` フラグの後に名前を指定して事前に設定できます。

招待するユーザーを指定ノードに自動配置するには、`--node` フラグの後に企業内のノード名を指定します。

#### 完全な例:

```
enterprise-user John_Smith@example.com --add --node "Chicago" --name "John Smith"
```

{% hint style="info" %}
`enterprise-user` コマンドの短縮形 `eu` も使用できます。

例: `eu John_Smith@example.com --add`
{% endhint %}

詳細は、[コマンドリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#enterprise-user-command)をご参照ください。

### 招待メールとボルトの作成

企業に参加するには、招待されたユーザーがメールで送信された招待を受け入れる必要があります。

<figure><img src="https://859776093-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPL6k1aGsLiFiiJ3Y7zCl%2Fuploads%2FDNteIHFK79GFMXhRB4sz%2Fimage.png?alt=media&#x26;token=dd791c67-a034-4470-be65-faf0938b2ce1" alt=""><figcaption><p>ユーザー招待メール</p></figcaption></figure>

ユーザーが **\[今すぐアカウントをセットアップ]** をクリックすると、Keeperウェブボルトに移動し、アカウント作成に進みます。

{% hint style="warning" %}
招待されたユーザーがボルトにログインするまで、ボルトは設定されずアクセスもできません。レコードの共有もできません。
{% endhint %}

### 例: ファイル内のメールアドレスからユーザーを招待する <a href="#example-invite-users-from-email-addresses-in-a-file" id="example-invite-users-from-email-addresses-in-a-file"></a>

メールアドレスの一覧を含むファイルから、各メールアドレスに招待を送信する例です。

#### 設定

* コマンダーを更新
  * 開始前に、コマンダーが最新バージョンであることを確認してください。最新リリースは[GitHubのリリースページ](https://github.com/Keeper-Security/Commander/releases)で入手できます。
* 永続ログインを設定
  * 永続ログインを有効にすると、コマンド呼び出しのたびにログインし直す必要がありません。\
    永続ログインを有効にするには、Keeperコマンダーで以下のコマンドを実行します。

```
this-device register
this-device persistent-login on
```

永続ログインとオプションの詳細は、[ドキュメントページ](/keeperpam/jp/commander-cli/commander-installation-setup/logging-in.md#persistent-login-sessions-stay-logged-in)をご参照ください。

#### はじめに

まず、メールアドレスをファイルにまとめます。この例では、ファイルは以下のとおりです。

{% code title="user\_emails.txt" %}

```
john_smith@example.com
jane_doe@example.com
mary_sue@example.com
chris_adams@example.com
amanda_patel@example.com
```

{% endcode %}

この例では、メールアドレスごとに1行です。ファイルには任意の数のメールアドレスを含められます。

#### 招待を送信

ファイルの準備ができたら、各メールアドレスに招待を送信する簡単なスクリプトを使用できます。

{% tabs %}
{% tab title="Windows Command Prompt" %}

```bash
for /f %e in (user_emails.txt) do keeper enterprise-user "%e" --add
```

{% endtab %}

{% tab title="Linux / MacOS Terminal" %}

```bash
while read email; do
   keeper enterprise-user "$email" --add
done < user_emails.txt
```

{% endtab %}
{% endtabs %}

上記の例から、ご利用のオペレーティングシステム用スクリプトを実行し、ファイル内の各メールアドレスに招待を送信します。

#### 高度な例: ユーザー名とノードを含める

上記の例を拡張し、ファイルにユーザーの表示名とノードを含め、招待送信時にアカウントへ反映できます。

この例では、ファイルは以下のとおりです。

{% code title="users.txt" %}

```
john_smith@example.com,John Smith,Chicago Office
jane_doe@example.com,Jane Doe,New York Office
mary_sue@example.com,Mary Sue,Chicago Office
chris_adams@example.com,Chris Adams,Chicago Office
amanda_patel@example.com,Amanda Patel,New York Office
```

{% endcode %}

各行には、ユーザーのメールアドレス、表示名、ノードがカンマ区切りで記載されています。

{% hint style="warning" %}
指定するノード名は、Keeperエンタープライズ内の既存ノード名と一致している必要があります。新規ユーザーへの招待送信前に、ノードが作成されている必要があります。
{% endhint %}

招待コマンドにこれらの情報を含めるには、スクリプトに該当フラグを追加します。

{% tabs %}
{% tab title="Windows Command Prompt" %}

```bash
for /f "tokens=1,2,3 delims=," %e in (users.txt) do keeper eu "%e" --add --name "%f" --node "%g"
```

{% endtab %}

{% tab title="Linux / MacOS Terminal" %}

```bash
while IFS=, read -r email name node; do
   keeper eu "$email" --add --name "$name" --node "$node"
done < users.txt
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
ここでは `enterprise-user` コマンドの短縮形 `eu` が使用されています。
{% endhint %}

ご利用のOSに適したスクリプトを実行すると、ファイル内の各ユーザーに招待メールが送信され、表示名が設定され、正しいノードに配置されます。

この例は、表示名やノードのみを指定する、特定のチームやロールへのユーザー追加など、用途に合わせて変更できます。

## ユーザーアカウントの新規作成

ユーザーがログインする前に、設定済みですぐに使えるユーザーアカウントとボルトが必要な場合があります。その場合は `create-user` コマンドを使用します。

### コマンダーでのユーザー作成

`create-user` コマンドを使用すると、新規ユーザーアカウントが作成され、企業内の他のアカウントとレコードを共有するために必要なエンタープライズデータキーが設定されます。この処理のため、新規アカウント作成時にはコマンダーから当該アカウントへのログインが1回必要です。

#### 形式:

```
create-user John_Smith@example.com --node "Chicago"
```

コマンド実行時、新規ユーザーのパスワード作成を求められます。または、ボルト内のレコードに設定済みのパスワードをアカウントのパスワードとして指定することもできます。

このコマンドの詳細は、[コマンドリファレンス](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#create-user-command)をご参照ください。

#### MFAまたはSSOログインを使用している企業

`create-user` コマンド使用時は、新規アカウントへのログインが必要です。企業でMFAまたはSSOログインが必須の場合、ボルト作成を完了するために新規アカウントに対応するクレデンシャルが必要です。

`create-user` の使用は、特殊な状況、またはMFAまたはSSOログインの設定・必須化前の初回エンタープライズ作成時に限定することを推奨します。

### enterprise-userコマンドとの相違点

`create-user` コマンドは、`enterprise-user --add` 方式と以下の点で異なります。

* `create-user` では、新規アカウントのパスワードをコマンダー利用者が設定する必要がある
  * (`enterprise-user --add` で招待されたユーザーは、アカウント作成時に自身のパスワードを設定する)
* `create-user` では、新規アカウントへのログインが必要
* `create-user` によるユーザーアカウント作成時は、ボルトが直ちに作成され、すぐにアクセスしたりレコードを共有したりできる

`create-user` は、特殊な状況、または初回の新規エンタープライズ作成時にのみ使用してください。

### ファイルからユーザーアカウントを作成

ファイル内のメールアドレス一覧で `create-user` コマンドを使用するには、上記の `enterprise-user` コマンドの[手順](/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands.md#example-invite-users-from-email-addresses-in-a-file)に従い、コマンドを `create-user` に置き換えます。

例:

{% tabs %}
{% tab title="Windows Command Prompt" %}

```bash
for /f "tokens=1,2,3 delims=," %e in (users.txt) do keeper create-user "%e" --name "%f" --node "%g"
```

{% endtab %}

{% tab title="Linux / MacOS Terminal" %}

```bash
while IFS=, read -r email name node; do
   keeper create-user "$email" --name "$name" --node "$node"
done < users.txt
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.keeper.io/keeperpam/jp/commander-cli/command-reference/enterprise-management-commands/creating-and-inviting-users.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
