> 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/general/office365-license-report.md).

# Office 365 ライセンス レポート

Microsoft 365 のライセンス使用状況と利用可能数をレポート

### 説明

テナント内の Microsoft 365 ライセンスのレポートを作成し、使用中の数と未使用の数を示します。共有メールボックスのライセンスなど、Exchange Online の詳細を追加できます。レポート ファイルは、単一ファイルとして、またはダウンロード リンク付きの ZIP 1 つとして、Azure Storage Account にアップロードできます。実際のユーザー データが要求されない限り何も変更されず、その場合はレポートのプライバシー設定が一時的にオフになり、その後元に戻されます。

### エクスポート用の Storage Account を構成します

レポート ファイルは既存の Azure Storage Account にアップロードされます。自動的には作成されません。推奨構成は共有の `RJReport.StorageAccount` 設定で、他のレポート runbook でも使用される設定です（ [Runbook レポート設定](https://docs.realmjoin.com/automation/runbooks/runbook-report-settings)). `LinkExpiryDays` ダウンロード リンクの有効期限日数を設定します（既定値 6）。 `SubscriptionId` は省略可能ですが、推奨されます。これにより、アップロードが Storage Account を含むサブスクリプションを使用することが保証されます（参照 [Storage Account のサブスクリプション](https://docs.realmjoin.com/automation/runbooks/runbook-report-settings#subscription-of-the-storage-account)）。コンテナー名は `OfficeLicensingReport.Container`この runbook のスイッチは、 `OfficeLicensingReport.*` 設定でもバックアップされているため、テナントごとに既定値を固定できます。

```json
{
	"Settings": {
		"RJReport": {
			"StorageAccount": {
				"ResourceGroup": "rj-test-runbooks-01",
				"StorageAccountName": "rbexports01",
				"SubscriptionId": "00000000-0000-0000-0000-000000000000",
				"LinkExpiryDays": 6
			}
		}
	}
}
```

Automation Account のマネージド ID には `Reader and Data Access` Storage Account 上のロールが必要です。

以下の runbook 固有の設定も引き続き読み込まれます。リソース グループ名と Storage Account 名が設定されている場合は、 `RJReport.StorageAccount`; `SubscriptionId` それらと一緒にのみ使用されます。

```json
{
	"Settings": {
		"OfficeLicensingReport": {
			"ResourceGroup": "rj-test-runbooks-01",
			"SubscriptionId": "00000000-0000-0000-0000-000000000000",
			"StorageAccount": {
				"Name": "rbexports01"
			}
		}
	}
}
```

runbook のカスタマイズ方法の詳細については、 [Runbook カスタマイズ ガイド](https://docs.realmjoin.com/automation/runbooks/runbook-customization).

### 場所

Organization → General → Office365 License Report

**完全な Runbook 名**

rjgit-org\_general\_office365-license-report

### 詳細

| プロパティ    | 値                                                                                                                                                         |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| バージョン    | 1.2.0                                                                                                                                                     |
| 必須モジュール  | <p>RealmJoin.RunbookHelper (>= 0.8.10)<br>Microsoft.Graph.Authentication (>= 2.41.2)<br>ExchangeOnlineManagement (>= 3.9.2)<br>Az.Accounts (>= 5.5.2)</p> |
| スケジュール可能 | いいえ                                                                                                                                                       |

### アクセス許可

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

* **型**: Microsoft Graph
  * Directory.Read.All
    * */subscribedSkus とグループのライセンス割り当てを読み取り、SKU の概要を取得します*
  * Reports.Read.All
    * *Office 365 の使用状況およびアクティビティ レポートの CSV を /reports から取得します*
  * ReportSettings.ReadWrite.All
    * *includeUserData が有効な場合、非表示のレポート名を一時的に無効にし、その後設定を元に戻します*
  * User.Read.All
    * *ユーザーを一覧表示し、ユーザーごとのレポートのためにライセンス詳細を読み取ります*
  * AuditLog.Read.All *（省略可能 — 機能: サインイン エクスポート）*
    * *exportToFile が有効な場合、アプリケーションごとのサインイン エクスポート用に /auditLogs/signIns を読み取ります（既定でオン）*
* **型**: Office 365 Exchange Online
  * Exchange.ManageAsApp *（省略可能 — 機能: Exchange ライセンス レポート）*
    * *includeExchange が有効な場合、共有メールボックスのライセンス レポートのために Get-EXOMailbox を実行します*

#### 権限に関する注意事項

Azure Storage Account: 対象 Storage Account に対する Automation Account のマネージド ID に 'Reader and Data Access' ロールが必要です。アップロードでは listKeys を使ってアカウント キーを取得します（exportToFile が有効な場合にのみ必要）

#### RBAC ロール

* Exchange Administrator
  * *includeExchange が有効な場合の app-only Exchange Online セッションに必要です*

### パラメーター

#### printOverview

実行出力に、各ライセンス SKU ごとの合計、使用中、利用可能、停止中の数を表形式で表示します。

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

#### includeExchange

共有メールボックスのライセンスなど、Exchange Online レポートを追加します。

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

#### includeUserData

実行時にレポートのプライバシー設定をオフにすることで、アクティビティ レポートに実際のユーザー名を表示します。後で元に戻されます。レポートには個人データが含まれるため、まずデータ保護ルールを確認してください。

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

#### exportToFile

テナント設定で構成された Azure Storage Account にレポート ファイルをアップロードします。

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

#### exportAsZip

個別のレポート ファイルの代わりに ZIP ファイル 1 つをアップロードします。

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

#### produceLinks

アップロードされたファイルへの期限付きダウンロード リンクを返します。

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

#### ContainerName

レポート ファイルがアップロードされる Storage Account のコンテナー。テナント設定 OfficeLicensingReport.Container から取得されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      | rjrb-licensing-report-v2 |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### ResourceGroupName

レポート アップロード用の Storage Account のリソース グループ。テナント設定 OfficeLicensingReport.ResourceGroup から取得され、未設定の場合は RJReport.StorageAccount.ResourceGroup が使用されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### StorageAccountName

レポート アップロード用の Storage Account。テナント設定 OfficeLicensingReport.StorageAccount.Name から取得され、未設定の場合は RJReport.StorageAccount.StorageAccountName が使用されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### SubscriptionId

レポート アップロード用の Storage Account のサブスクリプション ID。テナント設定 OfficeLicensingReport.SubscriptionId から取得され、OfficeLicensingReport.\* と一緒にのみ使用されます。空の場合は、マネージド ID がサインインするサブスクリプションを意味します。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### RJReportResourceGroupName

レポート アップロード用の Storage Account のリソース グループ。テナント設定 RJReport.StorageAccount.ResourceGroup から取得され、OfficeLicensingReport.ResourceGroup が未設定の場合に使用されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### RJReportStorageAccountName

レポート アップロード用の Storage Account。テナント設定 RJReport.StorageAccount.StorageAccountName から取得され、OfficeLicensingReport.StorageAccount.Name が未設定の場合に使用されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### RJReportSubscriptionId

レポート アップロード用の Storage Account のサブスクリプション ID。Tenant 設定 RJReport.StorageAccount.SubscriptionId から取得され、Storage Account が RJReport.StorageAccount から取得される場合に使用されます。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      |                          |
| 型        | 文字列                      |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

#### LinkExpiryDays

ダウンロード リンクの有効期間（日数）。テナント設定 RJReport.StorageAccount.LinkExpiryDays から取得します。

| プロパティ    | 値                        |
| -------- | ------------------------ |
| 必須       | false                    |
| 既定値      | 6                        |
| 型        | Int32                    |
| ポータルで非表示 | はい（runbook のカスタマイズで事前設定） |

[Runbook リファレンスの概要に戻る](https://docs.realmjoin.com/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 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/zi-dong-hua/runbooks/runbook-references/org/general/office365-license-report.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.
