> 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-devices-without-primary-user.md).

# 主要ユーザーがいないデバイスのレポート

### 説明

このスクリプトは、Intune からすべての管理対象デバイスを取得し、プライマリ ユーザー（userId）が設定されていないものを除外します。出力は、プライマリ ユーザーがいない各デバイスについて、オブジェクト ID、デバイス ID、表示名、最終同期日時を示す整形済みテーブルです。

必要に応じて、詳細なデバイス情報を含む CSV 添付ファイル付きでレポートをメール送信できます

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

メール レポートの送信は任意で、受信者（`EmailTo`）が指定されている場合にのみ行われます。送信者アドレスは `RJReport.EmailSender` Tenant 設定から取得されます。

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

参照してください [RealmJoin Report Settings のドキュメント](https://docs.realmjoin.com/automation/runbooks/runbook-report-settings) 詳細について。

### 場所

組織 → デバイス → プライマリ ユーザーなしデバイスのレポート

**Runbook の完全名**

rjgit-org\_devices\_report-devices-without-primary-user

### 権限

#### アプリケーション権限

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

### Parameters

#### EmailFrom

送信者のメールアドレス。これは runbook のカスタマイズで設定する必要があります。

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

#### EmailTo

指定した場合、レポートを含むメールが指定された宛先に送信されます。単一のアドレスでも、カンマ区切りの複数アドレス（文字列）でも指定できます。プライバシーのため、関数は各受信者に個別のメールを送信します。

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

[Runbook Reference の概要に戻る](/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-devices-without-primary-user.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.
