> 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/onboarding-realmjoin-portal/advanced-setup.md).

# 高度なセットアップ

高度なセットアップでは、アクセス許可をより細かくカスタマイズして割り当てることができます。この方法はより柔軟ですが、より複雑で、RealmJoin PowerShell モジュールの実行が必要です。

RealmJoin PowerShell モジュールは、あなたの RealmJoin テナントのセットアップを自動化します。内容は次のとおりです:

* RealmJoin アプリケーションに必要な Microsoft Entra ID のサービス プリンシパルを作成します
* 選択した機能に基づいて適切な Microsoft Graph のアクセス許可を割り当てます
* RealmJoin の機能（Portal、Intune LAPS、Autopilot、デバイス操作、修復スクリプト、セキュリティ機能）を構成します
* 以前の構成からレガシー アプリケーションをクリーンアップします

このモジュールは次に公開されています: [PowerShell Gallery](https://www.powershellgallery.com/packages/RealmJoin).

## 前提条件

{% hint style="info" %}
必要な Azure PowerShell モジュール（`Az.Accounts`, `Az.Resources`, `Az.Automation`）は、コマンドを初めて実行したときに、モジュールで固定されたバージョンが現在のユーザーに対して自動的にインストールされます。
{% endhint %}

* **PowerShell 5.1** 以降（Windows PowerShell または PowerShell 7）
* 次の操作ができるアカウント: **サービス プリンシパルを作成し、アプリケーションのアクセス許可を付与する** Microsoft Entra ID で — たとえば *グローバル管理者* または *特権ロール管理者*
* サインインは次を通じて行われます: `Connect-AzAccount`、これは次を使用します **Azure PowerShell** ファーストパーティ アプリケーション。ユーザーの同意を制限しているテナントでは、最初に管理者がそのアプリケーションに管理者の同意を付与する必要がある場合があります。
* 次へのアクセス [PowerShell Gallery](https://www.powershellgallery.com/packages/RealmJoin) モジュールをインストールするための

{% hint style="info" %}
バージョン 2.0 以降、このモジュールは次を使用してサインインします **Azure PowerShell** アプリケーションと `Az` モジュール。以前のバージョンでは代わりに Microsoft Graph PowerShell アプリケーションを使用していました。したがって、テナントがそれだけに同意していた場合は、Azure PowerShell アプリケーションへの同意を 1 回行う必要があります。
{% endhint %}

## 推奨セットアップ

RealmJoin Portal に表示されるセットアップ コマンドでは、次の権限が付与されます:

* コア機能
* Intune LAPS
* サインイン データ
* 修復スクリプト
* Autopilot
* Intune デバイス操作

すべての機能または個別の機能を追加するには、次を参照してください: [その他のコマンド](#other-commands).

{% stepper %}
{% step %}

#### Windows/Mac で PowerShell を開く

RealmJoin PowerShell モジュールは、次の環境でインストールして実行することをお勧めします **新しく開いた** Azure Cloud Shell ではなく、ご自身のデバイス上の PowerShell セッションで実行してください。このモジュールには、次の正確なバージョンが必要です `Az.*` モジュール。セッションに別のバージョンがすでに読み込まれている場合（通常は Cloud Shell でそうなります）、新しいセッションを開かない限り解決できないバージョンの競合が発生して停止します。

昇格された（「管理者として実行」）セッションは不要です。モジュールは次のオプションでインストールされます `-Scope CurrentUser`.
{% endstep %}

{% step %}

#### RealmJoin オンボーディング スクリプトをコピーして実行する

スクリプトは Azure へのサインインを求めます。サービス プリンシパルを作成し、アプリケーションのアクセス許可を付与できるアカウント、たとえばグローバル管理者を使用してください。

```powershell
Install-Module -Force -Name RealmJoin
Complete-RJTenantOnboarding -Token 1234ABCD 6>&1
```

{% hint style="info" %}
**概要 `6>&1`:** これらのコマンドは、進行状況の更新を PowerShell の Information ストリームに書き込みます。 `6>&1` リダイレクトすると、その出力がコンソールに表示されます。これがないと、実行中の詳細な進行状況メッセージは表示されません。
{% endhint %}

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FdxYM2mTZ5LNcJhgudknf%2FSnipaste_2026-01-27_12-00-54.png?alt=media&amp;token=1fa4cd4e-485a-43e4-8a90-f6e6f6f57cb5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### RealmJoin の使用を開始する

完了すると、スクリプトは RealmJoin Portal を起動します

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FuW5XSaHN6B96xxR5g9ko%2FSnipaste_2026-01-27_12-18-57.png?alt=media&amp;token=18b3608f-299c-40cf-a7b2-796d410884d2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**終了後のサインアウト:** コマンドの終了後も Azure のサインインはアクティブなままです。作業が終わったら、次を実行してください `Disconnect-AzAccount` 既存のセッションからサインアウトします。
{% endhint %}
{% endstep %}
{% endstepper %}

## その他のコマンド

### 対話型セットアップ

テナントのセットアップ、構成変更、Log Analytics Workspace および Automation Account を含む、ガイド付きのメニュー形式の操作を行うには:

```powershell
Show-RJInteractiveSetup
```

何かを構成する前に、利用可能な機能を確認するには:

```powershell
Show-RJFeatureInfo
```

### カスタム構成

#### 既定の機能

必須のコア ポータル機能に加え、既定のオプション機能（RealmJoin Client を除くすべて）を有効にします:

```powershell
New-RJTenant 6>&1
```

#### 最小機能（必須機能のみ）

```powershell
New-RJTenant -Features @('RealmJoinPortal') 6>&1
```

#### 完全な機能セット

```powershell
New-RJTenant -All 6>&1
```

#### 読み取り専用アクセス許可

利用可能な場合は読み取り専用のアクセス許可を割り当てます（たとえば、 `Group.ReadWrite.All` は次になります `Group.Read.All`):

```powershell
New-RJTenant -ReadOnly 6>&1
```

#### カスタム機能の選択

```powershell
New-RJTenant -Features @('RealmJoinPortal', 'IntuneLAPS', 'Autopilot') 6>&1
```

### 既存の構成を更新する

`Update-RJTenant` は、すでに構成済みのテナントを調整します。エイリアス `Complete-RJTenantOnboarding` は次と同等に使用できます `Update-RJTenant`.

#### 新しい機能を追加する

```powershell
Update-RJTenant -AddFeatures @('SecurityFeatures') 6>&1
```

#### 機能を削除する

```powershell
Update-RJTenant -RemoveFeatures @('ShowSignin') 6>&1
```

#### 読み取り専用アクセス許可に切り替える

```powershell
Update-RJTenant -ReadOnly 6>&1
```

#### 変更をプレビューする

```powershell
Update-RJTenant -AddFeatures @('SecurityFeatures') -WhatIf 6>&1
```

### Azure リソース

このモジュールは、RealmJoin が使用する付随的な Azure リソースもデプロイします。これらは Graph のアクセス許可機能ではなく、次のオプションでは選択されません `-Features`:

* `Set-RJLogAnalyticsWorkspace` — カスタム テーブルと Data Collection Rules を備えた Log Analytics Workspace をデプロイします。詳細は次を参照してください [Azure Log Analytics Workspace への接続](/ja/torogu/log-analytics.md)
* `Set-RJAutomationAccount` — マネージド ID と必要なアクセス許可を備えた RealmJoin Automation Account をデプロイします。詳細は次を参照してください [Azure Automation への接続](/ja/zi-dong-hua/connecting-azure-automation.md)

両方のコマンドは、RealmJoin Portal の該当する設定ページで、対応するパラメーターとオンボーディング トークンを使用して生成されます。

## 利用可能な機能

これらの機能名は次と一緒に使用してください `-Features`, `-AddFeatures`、および `-RemoveFeatures` パラメーター。必須機能は常に有効です。既定の構成（`New-RJTenant` パラメーターなし）では、以下に示す機能が有効になります。 **SecurityFeatures** と **Client** は明示的に選択する必要があります。

| 機能                              | 説明                                        |  既定 |
| ------------------------------- | ----------------------------------------- | :-: |
| `RealmJoinPortal`               | ユーザーのセルフサービスと管理者とのやり取りのためのコア ポータル機能（必須）   |  ☑️ |
| `IntuneLAPS`                    | Intune LAPS 経由でローカル管理者パスワードを取得および管理します    |  ☑️ |
| `ShowSignin`                    | ユーザーのサインイン履歴と監査ログを表示します                   |  ☑️ |
| `Autopilot`                     | Windows Autopilot のデプロイ プロファイルと状態を表示します   |  ☑️ |
| `DeviceIntuneActions`           | 特権デバイス操作（同期、再起動、ワイプなど）を実行します              |  ☑️ |
| `DeviceHealthScript`            | PowerShell 修復スクリプトをデバイスに管理および展開します        |  ☑️ |
| `BitLockerRecoveryKeys`         | 管理対象デバイスの BitLocker 回復キーを表示します            |  ☑️ |
| `WindowsDeviceUpdateEnrollment` | Windows Device Updates の登録を管理します          |  ☑️ |
| `SecurityFeatures`              | 高度な脅威保護とセキュリティ分析（MDE ライセンスが必要）            |     |
| `Client`                        | RealmJoin Agent — デバイス管理用のクライアント アプリケーション |     |

## トラブルシューティング

{% hint style="warning" %}
**「権限が不十分です」** — サービス プリンシパルの作成とアプリケーションのアクセス許可の付与には、適切な権限を持つアカウントが必要です。たとえば *グローバル管理者* または *特権ロール管理者*。詳細は次を参照してください [前提条件](#prerequisites).
{% endhint %}

{% hint style="warning" %}
**「管理者の承認が必要です」またはサインイン中の同意エラー** — サインインには次が使用されます **Azure PowerShell** ファーストパーティ アプリケーション。テナントがユーザーの同意を制限している場合、管理者はそのアプリケーションに対して一度管理者の同意を付与する必要があります。
{% endhint %}

{% hint style="warning" %}
**「RealmJoin モジュールは古くなっています - 実行を続行できません」** — 各コマンドは、セッションごとに 1 回、最新の公開バージョンを実行していることを確認します。現在のバージョンをインストールし、セッションを閉じて新しいものを開いてください:

```powershell
Install-Module -Name RealmJoin -Force -Scope CurrentUser
```

{% endhint %}

{% hint style="warning" %}
**モジュールのバージョン競合が報告されます** — `Az.*` モジュールが固定しているものとは別のバージョンのモジュールがすでに読み込まれています。これは実行中のセッションでは修正できません。PowerShell を閉じ、新しいセッションを開いて、コマンドを再度実行してください。
{% endhint %}

モジュールが見つからない場合は、PowerShell Gallery が利用可能であることを確認し、再インストールしてください:

```powershell
Get-PSRepository
Install-Module -Name RealmJoin -Force -Scope CurrentUser
```

### ヘルプの取得

```powershell
Get-Help New-RJTenant -Full
Get-Help Update-RJTenant -Examples
Get-Help Show-RJInteractiveSetup -Detailed
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/ja/zhan-kai/onboarding-realmjoin-portal/advanced-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
