> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/yzoyobipurojekuto/user-management.md).

# ユーザー管理

## 管理者ユーザーの作成

Overleaf Toolkit のデプロイ:

{% code title="Overleaf Toolkit" overflow="wrap" %}

```bash
$ bin/docker-compose exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/create-user --admin --email=joe@example.com"
```

{% endcode %}

旧 docker-compose.yml のデプロイ:

{% code title="旧 docker-compose" overflow="wrap" %}

```bash
$ docker exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/create-user --admin --email=joe@example.com"
```

{% endcode %}

このコマンドは、指定されたメールアドレスのユーザーがまだ存在しない場合はそのユーザーを作成し、管理者にします。コマンドの出力には、このユーザーのパスワードを設定して初めてログインするための URL が含まれています。

{% hint style="info" %}
プログラムによる方法では、同じスクリプトを使って通常ユーザーと管理者の両方を作成できます。通常ユーザーの場合は --admin フラグを省略します。
{% endhint %}

認証に内部アカウントを使用していて、既存ユーザーをインスタンス管理者に昇格させるか、管理者権限を取り消す必要がある場合は、次の手順に従ってください:

{% stepper %}
{% step %}

### 管理 UI から

* 既存の管理者としてログインします。
* Admin -> Manage Users をクリックします。
* ユーザーを検索し、そのメールアドレスをクリックします。
* Site Admin セクションまでスクロールし、(show) リンクをクリックします。
* Is Site Admin チェックボックスをオンにします。
* Save をクリックして完了します。
  {% endstep %}
  {% endstepper %}

***

## ユーザーの削除

のガイドで説明しているように [ライセンス使用量の理解](broken://pages/9a438457aaf709b6bb3bf9fd861adc096a428924)、アカウントが不要でなくなるまでは削除しないことが一般的に推奨されます。アカウントを削除すると、そのアカウントは削除され、共同編集者はプロジェクトにアクセスできなくなります。現在、アカウントを無効化する方法はありません。アカウントは、データを保持したまま存在し続けるか、削除されるかのどちらかです。

既定では、アカウントはソフト削除されます。インスタンスからユーザーを完全に削除する方法については、 `ENABLE_CRON_RESOURCE_DELETION` の [環境変数](broken://pages/f551e336de5a86c3f4fe6bfa88c2b6919b241a94) ガイドを参照してください。

{% hint style="info" %}
アカウントは既定でソフト削除されます。 `ENABLE_CRON_RESOURCE_DELETION` で完全削除の動作について確認してください。
{% endhint %}

### Admin -> Manage Users から

{% stepper %}
{% step %}

* 管理者としてログインします。
* Admin -> Manage Users をクリックします。
* ユーザーを検索し、メールアドレスの横にあるチェックボックスをオンにします。
* ゴミ箱アイコンをクリックします。
* Delete をクリックして確定します。
  {% endstep %}
  {% endstepper %}

### コマンドラインから

以下のコマンドを使用して、ユーザーアカウント（およびそのプロジェクト）を削除できます。

Overleaf Toolkit のデプロイ:

{% code title="Overleaf Toolkit" %}

```bash
$ bin/docker-compose exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/delete-user.mjs --email=joe@example.com"
```

{% endcode %}

旧 docker-compose.yml のデプロイ:

{% code title="旧 docker-compose" %}

```bash
$ docker exec sharelatex /bin/bash -ce "cd /overleaf/services/web && node modules/server-ce-scripts/scripts/delete-user.mjs --email=joe@example.com"
```

{% endcode %}

{% hint style="danger" %}
削除スクリプトはハードコードされた force オプションを使用しており、アカウント削除メールの送信に失敗しても（たとえば、ユーザーのメールアドレスが既に使用されていない場合でも）削除が続行されるようになっています。
{% endhint %}

{% hint style="info" %}
バージョン 5.5.0 以降では、--skip-email オプションを使用して、削除されたユーザーに案内メールを送信しないようにできます。
{% endhint %}

***

## ソフト削除されたユーザーの復元

ユーザーがソフト削除されただけの場合は、そのアカウントとプロジェクトを復元できます。

{% stepper %}
{% step %}

* 管理者としてログインします。
* Admin -> Manage Users をクリックします。
* 復元したいユーザーを検索します。
* Display deleted users ボタンをクリックします。
* 削除されたユーザーのメールアドレスをクリックします。
* Recover This Account をクリックします。
* Recover をクリックして確定します。
  {% endstep %}
  {% endstepper %}

{% hint style="danger" %}
ENABLE\_CRON\_RESOURCE\_DELETION が true に設定されている場合、ソフト削除されたアカウントは 90 日以内であれば復元できます。90 日を過ぎると、アカウントの復元はできません。
{% endhint %}

***

## ユーザー数のカウント

ユーザー数は、<https://you-instance-url/admin/user#license> の管理 UI から確認できます。プログラムによるチェックやエクスポートには、以下の例が役立ちます。

ユーザー総数:

{% code title="ユーザー総数" %}

```bash
echo 'db.users.countDocuments()' | docker exec -i mongo mongosh --quiet localhost/sharelatex
# overleaf [direct: primary] sharelatex> 16
```

{% endcode %}

メトリクスエンドポイントを使用したユーザー総数:

{% code title="メトリクスによるアクティブユーザー数" %}

```bash
docker exec sharelatex curl http://127.0.0.1:3000/metrics | grep num_active_users
# # HELP num_active_users num_active_users
# # TYPE num_active_users gauge
# num_active_users{app="web-api",host="b3ae4ff549d8"} 16
```

{% endcode %}

アクティブユーザー総数（例: 過去 365 日以内にアクティブだったユーザー）:

{% code title="アクティブユーザー総数" %}

```bash
echo 'db.users.countDocuments({ lastActive: { $gte: new Date(new Date().getTime() - (365 * 24 * 60 * 60 * 1000)) } })' | docker exec -i mongo mongosh --quiet localhost/sharelatex
# overleaf [direct: primary] sharelatex> 10
```

{% endcode %}

***

## ユーザーアカウント情報の更新

アカウント更新の方法は、SSO が有効かどうかによって異なります。

* SSO を使用していない場合:
  * 管理者は Admin -> Manage Users からユーザーアカウント情報（メールアドレス、名、姓、パスワードリセットリンクの生成）を変更できます。
  * 通常ユーザーは Account -> Account Settings から自分の詳細を更新できます（パスワードの変更や Git 認証トークンの生成を含む）。
* SSO を使用している場合:
  * Server Pro は、認証システムに基づいてログイン時にユーザーの名と姓を更新するように設定できます。
  * OVERLEAF\_SAML\_UPDATE\_USER\_DETAILS\_ON\_LOGIN または OVERLEAF\_LDAP\_UPDATE\_USER\_DETAILS\_ON\_LOGIN が true の場合、<https://your-instance-url/user/settings> のユーザー詳細フォームは無効になり、名/姓は ID 管理システムでのみ設定できます。

詳細は以下を参照してください:

* SAML 2.0 設定: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/saml-2.0>
* LDAP 設定: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/ldap>

***

4 か月前に最終更新

このドキュメントページには、外部ガイドや設定ページへのリンクが含まれています。すべてのリンクとクエリパラメータは、元の内容と同じように保持されています。


---

# 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://ayakaleaf-pro.ayaka.space/on-premises/ja/yzoyobipurojekuto/user-management.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.
