> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/ja/zhan-kai/infrastructure/avd-templates.md).

# AVD テンプレート

## 概要

この機能を使用すると、アプリケーションのセット（いわゆるテンプレート）を定義できます。このアプリケーションのセットは、その後 RealmJoin Client を使用して、ヘッドレス / 無人の方法でコンピューターに適用できます。

これは Azure Virtual Desktop のマルチセッション プール ホスト向けのゴールデン イメージを作成するためのものです。

{% hint style="info" %}
Azure Virtual Desktop (AVD) テンプレートの作成と管理は、専門知識、綿密な計画、正確な構成を必要とする複雑な作業です。このページで説明されている RealmJoin 関連のトピックについてはすべて完全にサポートしますが、より広範な AVD テンプレート作成のトピックを支援できる範囲は限られています。これには、AVD テンプレートの作成、カスタマイズ、展開、トラブルシューティングに関する一般的なガイダンスが含まれますが、これに限定されません。
{% endhint %}

## 権限

機能を有効にするには、 [カスタム ロール](/ja/to/permission/custom-roles.md) を定義し、そのロールをグループまたはユーザーに割り当てる必要があります。

以下の定義をコピーし、GroupID を適宜変更してください。

```json
{
  "Rules": [
    {
      "Name": "管理者がテンプレート機能にアクセスできるようにする",
      "Groups": [
        "<管理者グループの Group ID>"
      ],
      "Permissions": [
        "CanReadTemplateTable",
        "CanReadTemplateDetails",
        "CanEditTemplate",
        "CanDeleteTemplate",
        "CanChangeTemplatePackages",
        "CanChangeTemplateTokens"
      ]
    }
  ]
}
```

## テンプレートの管理

### テンプレートの作成

1. 「templates」アイコンをクリックするか、次の URL を入力して Templates セクションを開きます: <https://portal.realmjoin.com/templates>

<figure><img src="/files/23e4b948dcdd38194e552b14cad322ac9366fb8c" alt=""><figcaption><p>テンプレート一覧</p></figcaption></figure>

2. 次の <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコン (1) をクリックし、意味のある名前 (2) を入力して、"Save" をクリックします (3)。

<figure><img src="/files/527f2ac1ad2d7a060e7ee3d8fdc6dda924455fd5" alt=""><figcaption><p>テンプレートを作成</p></figcaption></figure>

### テンプレートにアプリケーションを追加

1. 名前をクリックしてテンプレートを開きます。
2. テンプレートにパッケージを追加するには、次の <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコン。

<figure><img src="/files/6df675ef13f842b0d239c33e31b4f26a781fa52e" alt=""><figcaption><p>テンプレートにパッケージを追加 - 1</p></figcaption></figure>

3. パッケージを検索し、次の ![](/files/ecd7691d721f23e66ec40811e430abaf6a3bfa6b) アイコンを押してテンプレートに追加します。リストには、環境内で購読しているすべての RealmJoin パッケージが表示されます。
4. 完了したら、次の **閉じる** ボタンをクリックします。

<figure><img src="/files/06288b7621b095002278fb0eec6c6c4cd76f386e" alt=""><figcaption><p>テンプレートにパッケージを追加 - 2</p></figcaption></figure>

{% hint style="info" %}
Intune パッケージは AVD テンプレートを使用して割り当てることはできません。
{% endhint %}

### テンプレートからアプリケーションを削除

1. 名前をクリックしてテンプレートを開きます。
2. アプリケーションを削除したい場合は、 **割り当て解除**。パッケージ レベルで設定された内容を上書きする引数を定義したい場合は、次の **設定**.

<figure><img src="/files/d9bec83b8a41a4b9441d47d6b418c3a84af57bc6" alt=""><figcaption><p>テンプレートからパッケージを削除</p></figcaption></figure>

### トークンを作成

RealmJoin Client を介してテンプレートを使用するには、トークンも必要です。

{% hint style="warning" %}
トークンは慎重に扱ってください。漏えいした可能性があると思う場合は、次の **失効** トークンの横にあるボタンを押して無効化してください。
{% endhint %}

1. トークンを作成するには、次の **トークン** タブ。
2. 次の <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコン (1) をクリックし、意味のある名前 (2) を入力して、 **保存** (3).

<figure><img src="/files/dbe89f9221550648affd699d9425713de01f37d2" alt=""><figcaption><p>トークンを作成</p></figcaption></figure>

## テンプレートの使用

### AVD / ヘッドレス プロビジョニング

展開に使用するテンプレート ID とトークンを用意します。

<figure><img src="/files/2d4fcb82cbcb3e680fc76c5b8f946c7ced1d476b" alt=""><figcaption><p>テンプレート ID とトークンを見つける</p></figcaption></figure>

ゴールデン イメージとして準備したいシステム/VM 内で、次のコマンドを実行します:

1. RealmJoin をダウンロード: `Invoke-WebRequest -Uri "https://gkrealmjoin.s3.amazonaws.com/win-release/RealmJoin.exe" -OutFile "C:\temp\RealmJoin.exe"`
2. RealmJoin をインストール: `Start-Process -FilePath "C:\temp\RealmJoin.exe" -ArgumentList "-install" -Wait`
3. ヘッドレス展開を実行します。個別のテンプレート ID とトークンを必ず入力してください: `Start-Process -FilePath "C:\Program Files\RealmJoin\RealmJoinService.exe" -ArgumentList " -avdprovision <Template ID> <Template Token>"`

### ログとトレース

RealmJoin のインストールとヘッドレス展開の両方で、追加の引数 `-trace` を指定してログ出力を拡張できます。ヘッドレス展開中の状態/ログを確認するには、次の場所にある realmjoin.log を開いて定期的に更新してください: `C:\Windows\Logs\`


---

# 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.realmjoin.com/ja/zhan-kai/infrastructure/avd-templates.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.
