> 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/zi-dong-hua/runbooks/runbook-references/org/devices/report-primary-user-mismatch_scheduled.md).

# 主要ユーザー不一致レポート（定期実行）

### 説明

Windows 管理対象デバイスについて、このスケジュール済みレポートは、Intune に記録されたプライマリ ユーザーを RealmJoin の顧客 API に記録されたプライマリ ユーザーと比較します。デバイスごとに 2 つのデータセットを突き合わせ、プライマリ ユーザーが異なるデバイスをフラグ付けし、差分を CSV 添付ファイル付きでメール送信します。

### メール送信に関する設定

この runbook は Microsoft Graph API を使用してメールを送信します。Graph API 経由でメールを送信するには、runbook のカスタマイズで既存のメールアドレスを設定する必要があります。

この手順の詳細は次に記載されています [メール レポートのセットアップ](https://github.com/realmjoin/realmjoin-runbooks/tree/master/docs/general/setup-email-reporting.md) ドキュメントにあります。

### RealmJoin API 認証情報の設定

このランブックは RealmJoin の顧客 API をクエリし、Azure Automation Account に保存された専用の資格情報を必要とします。

**手順ごとのセットアップ:**

1. **API 認証情報を取得する** — まだ RealmJoin API 認証情報をお持ちでない場合は、<support@realmjoin.com> まで申請してください
2. **Automation Account を開く** — Azure Portal で、ランブックに使用する Automation Account に移動します
3. **Shared Resources > Credentials に移動します** — 左側メニューの *Shared Resources*、クリックします *Credentials*
4. **新しい資格情報を追加する** — クリックします *資格情報を追加*
5. **名前は正確に `RJAPI`** — ランブックはこの名前を参照します。少しでも異なると、資格情報の検索に失敗します
6. **RealmJoin API のユーザー名とパスワードを入力する** — 手順 1 の認証情報を使用します
7. **保存** — クリックします *作成* そしてランブックを再実行します

### 場所

組織 → デバイス → プライマリ ユーザー不一致をレポート (スケジュール済み)

**完全な Runbook 名**

rjgit-org\_devices\_report-primary-user-mismatch\_scheduled

### アクセス許可

#### アプリケーションのアクセス許可

* **種類**: Microsoft Graph
  * DeviceManagementManagedDevices.Read.All
  * Mail.Send
  * Organization.Read.All

### パラメーター

#### SyncThresholdDays

Intune の最終同期フィルターでさかのぼる日数です。この日数以内に同期した Windows デバイスのみが評価されます。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   | 30    |
| 種類    | Int32 |

#### DeviceNamePrefix

レポートを特定のデバイスのサブセットに絞り込むための、任意のデバイス名プレフィックスです。すべてのデバイスを含める場合は空欄のままにしてください。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   |       |
| 種類    | 文字列   |

#### IncludeMismatches

Intune と RealmJoin でプライマリ ユーザーが異なるデバイスをレポートに含めます。既定で有効です。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   | True  |
| 種類    | ブール値  |

#### IncludeMissingInRealmJoin

Intune には存在するが RealmJoin に一致するデバイスがないデバイスをレポートに含めます。既定で無効です。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   | False |
| 種類    | ブール値  |

#### IncludeMissingInIntune

RealmJoin には存在するが Intune に一致するデバイスがないデバイスをレポートに含めます。既定で無効です。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   | False |
| 種類    | ブール値  |

#### EmailTo

レポートを受信する宛先メールアドレス（またはカンマ区切りの複数のアドレス）。

| プロパティ | 値    |
| ----- | ---- |
| 必須    | true |
| 既定値   |      |
| 種類    | 文字列  |

#### EmailFrom

送信者のメールアドレスです。これはランブックのカスタマイズ設定で構成され、ポータルでは非表示です。

| プロパティ | 値     |
| ----- | ----- |
| 必須    | false |
| 既定値   |       |
| 種類    | 文字列   |

[Runbook リファレンスの概要に戻る](/ja/zi-dong-hua/runbooks/runbook-references.md)


---

# 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/zi-dong-hua/runbooks/runbook-references/org/devices/report-primary-user-mismatch_scheduled.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.
