> 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/outphase-devices.md).

# デバイスを段階的に廃止

複数のデバイスを一括でワイプしてクリーンアップ

### 説明

デバイス ID またはシリアル番号の一覧を指定して、複数のデバイスを一括でサービス対象外にします。デバイスをワイプするか、Intune からのみ削除するか、また Autopilot 登録を削除するかを選択できます。Entra ID オブジェクトは、削除、無効化、または保持が可能です。必要に応じて、Microsoft Defender for Endpoint でデバイスにタグを付け、タグを使用するルールが自動修復の対象から除外できるようにします。ワイプするとすべてのデータが削除され、元に戻せません。

### Microsoft Defender for Endpoint の除外タグ

Microsoft Defender for Endpoint にはネイティブの **除外状態** （デバイス インベントリ フィルターでは *除外済み* / *非除外*と表示されます）。この状態は Defender ポータルでのみ設定できます。 **API はありません** デバイスのネイティブな除外状態をプログラムで設定するための。

ネイティブの除外状態は自動化できないため、この runbook では代わりにカスタムのデバイス タグ（既定値 `ExcludeFromRemediation`）を適用します。 *Microsoft Defender for Endpoint からデバイスを除外する* が有効な場合です。リスト内の各デバイスは Entra ID のデバイス ID で検索され、 `POST /api/machines/{id}/tags`を通じてタグ付けされ、除外されたデバイスをフィルターおよび対象指定するためのマーカーが提供されます。

#### 1 回限りの設定: タグをフィルター可能にする

ポータルの **Tags** フィルターには、ポータル経由で作成されたタグのみが一覧表示されます。API のみで設定されたタグはデバイスに付与され、デバイス ページでは表示されますが、 **表示されません** 。単独では Tags フィルターには表示されません。

除外タグを表示して [Defender Device Inventory](https://security.microsoft.com/machines)でフィルターに使用できるようにするには、1 台のクライアントを一度だけポータルから手動でタグ付けする必要があります（デバイスを選択 > **タグを管理** > 「新しいタグの作成」、同じタグ値を正確に使用）。この 1 回限りの手順の後、タグは既知のフィルター可能なタグになり、この runbook で大量のデバイスに適用できるようになります。

> **注意:** このタグは単なるラベルであり、デバイスのネイティブな除外状態は設定されず、単独では修復効果もありません。Defender のデバイス グループまたは自動化ルールがこのタグ値に一致するよう明示的に構成されている場合にのみ有効です。このようなルールはポータルの **Tags** フィルターとは独立してタグ値そのものに一致するため、1 回限りの手動手順は、ポータル UI でそのタグをフィルター対象として選択できるかどうかにのみ影響します。

シリアル番号で指定されたデバイスが Intune で見つからない場合、Entra ID のデバイス ID は存在しないため、Defender ではタグ付けされません。

詳細は [デバイスタグの作成と管理](https://learn.microsoft.com/defender-endpoint/machine-tags#create-tags) を参照してください。

### 場所

Organization → Devices → Outphase Devices

**完全な Runbook 名**

rjgit-org\_devices\_outphase-devices

### 詳細

| プロパティ    | 値                                   |
| -------- | ----------------------------------- |
| バージョン    | 1.2.1                               |
| 必須モジュール  | RealmJoin.RunbookHelper (>= 0.8.10) |
| スケジュール可能 | いいえ                                 |

### 権限

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

* **種類**: Microsoft Graph
  * DeviceManagementManagedDevices.PrivilegedOperations.All
    * *ワイプ アクションが選択された場合、managedDevices/{id}/wipe を介してデバイスのワイプを実行します*
  * DeviceManagementManagedDevices.ReadWrite.All
    * *Intune のデバイスをシリアル番号または azureADDeviceId で検索して削除します*
  * DeviceManagementServiceConfig.ReadWrite.All
    * *デバイスの Autopilot レコードを検索して削除します*
  * Device.Read.All
    * *レポート用に Entra デバイス オブジェクトとその登録済み所有者を検索します*
* **種類**: WindowsDefenderATP
  * Machine.Read.All
    * */machines を aadDeviceId で絞り込んで、Defender for Endpoint でデバイスを検索します*
  * Machine.ReadWrite.All
    * *excludeFromDefender が有効な場合、/machines/{id}/tags を介して除外タグを追加します*

#### RBAC ロール

* Cloud Device Administrator
  * */devices/{id} を介して Entra デバイス オブジェクトを無効化および削除するために必要です*

### パラメーター

#### DeviceListChoice

一覧が Entra ID のデバイス ID かシリアル番号のどちらを含むか。

| プロパティ   | 値     |
| ------- | ----- |
| 必須      | true  |
| 既定値     | 0     |
| 種類      | Int32 |
| ポータル表示名 | 一覧の内容 |

**ポータルのオプション**

| ポータル オプション | 値 |
| ---------- | - |
| デバイス ID    | 0 |
| シリアル番号     | 1 |

#### DeviceList

デバイス ID またはシリアル番号をカンマ区切りで指定します。

| プロパティ   | 値      |
| ------- | ------ |
| 必須      | true   |
| 既定値     |        |
| 種類      | 文字列    |
| ポータル表示名 | デバイス一覧 |

#### intuneAction

完全ワイプは、デバイス上のすべてのユーザー データと登録データを消去します。Intune からの削除は、すでにワイプ済みまたは破棄済みのデバイスについて、デバイス レコードのみを削除します。ワイプせず、または削除しない場合は Intune には何も変更されません。

| プロパティ   | 値          |
| ------- | ---------- |
| 必須      | false      |
| 既定値     | 2          |
| 種類      | Int32      |
| ポータル表示名 | Intune の操作 |

**ポータルのオプション**

| ポータル オプション                          | 値 |
| ----------------------------------- | - |
| デバイスを完全にワイプする（ユーザー データや登録データは保持しない） | 2 |
| Intune からデバイスを削除する                  | 1 |
| デバイスをワイプせず、Intune からも削除しない          | 0 |

#### aadAction

Delete はデバイス オブジェクトを Entra ID から削除し、Disable は保持したままデバイスからのサインインをブロックし、Keep は Entra ID に変更を加えません。

| プロパティ   | 値               |
| ------- | --------------- |
| 必須      | false           |
| 既定値     | 2               |
| 種類      | Int32           |
| ポータル表示名 | Entra ID オブジェクト |

**ポータルのオプション**

| ポータル オプション           | 値 |
| -------------------- | - |
| Entra ID のデバイスを削除する  | 2 |
| Entra ID のデバイスを無効化する | 1 |
| Entra ID のデバイスを保持する  | 0 |

#### wipeDevice

互換性のために残されたレガシー スイッチです。「Intune の操作」での選択によって、デバイスをワイプするかどうかが決まります。

| プロパティ    | 値                         |
| -------- | ------------------------- |
| 必須       | false                     |
| 既定値      | True                      |
| 種類       | ブール値                      |
| ポータルで非表示 | はい (Runbook のカスタマイズで事前設定) |

#### removeIntuneDevice

互換性のために残されたレガシー スイッチです。「Intune の操作」での選択によって、Intune レコードを削除するかどうかが決まります。

| プロパティ    | 値                         |
| -------- | ------------------------- |
| 必須       | false                     |
| 既定値      | False                     |
| 種類       | ブール値                      |
| ポータルで非表示 | はい (Runbook のカスタマイズで事前設定) |

#### removeAutopilotDevice

デバイスを Autopilot データベースから削除すると、テナントから離脱して別の場所で登録できるようになります。保持すると、このテナントで後で再展開できます。

| プロパティ   | 値                         |
| ------- | ------------------------- |
| 必須      | false                     |
| 既定値     | True                      |
| 種類      | ブール値                      |
| ポータル表示名 | Autopilot データベースから削除しますか? |

**ポータルのオプション**

| ポータル オプション             | 値     |
| ---------------------- | ----- |
| デバイスを Autopilot から削除する | true  |
| デバイスを保持する              | false |

#### removeAADDevice

互換性のために残されたレガシー スイッチです。「Entra ID オブジェクト」での選択によって、Entra ID オブジェクトを削除するかどうかが決まります。

| プロパティ    | 値                         |
| -------- | ------------------------- |
| 必須       | false                     |
| 既定値      | True                      |
| 種類       | ブール値                      |
| ポータルで非表示 | はい (Runbook のカスタマイズで事前設定) |

#### disableAADDevice

互換性のために残されたレガシー スイッチです。「Entra ID オブジェクト」での選択によって、Entra ID オブジェクトを無効化するかどうかが決まります。

| プロパティ    | 値                         |
| -------- | ------------------------- |
| 必須       | false                     |
| 既定値      | False                     |
| 種類       | ブール値                      |
| ポータルで非表示 | はい (Runbook のカスタマイズで事前設定) |

#### excludeFromDefender

Microsoft Defender for Endpoint でデバイスに除外タグを付け、タグを使用するルールが自動修復の対象から除外できるようにします。Skip を選ぶと Defender に変更は加えられません。

| プロパティ   | 値                                     |
| ------- | ------------------------------------- |
| 必須      | false                                 |
| 既定値     | False                                 |
| 種類      | ブール値                                  |
| ポータル表示名 | Defender for Endpoint で除外としてタグ付けしますか? |

**ポータルのオプション**

| ポータル オプション                              | 値     |
| --------------------------------------- | ----- |
| Defender for Endpoint でデバイスを除外としてタグ付けする | true  |
| Defender の操作をスキップする                     | false |

#### defenderExclusionTag

Defender for Endpoint のデバイスに書き込まれるタグ名。除外ルールで使用します。

| プロパティ   | 値                      |
| ------- | ---------------------- |
| 必須      | false                  |
| 既定値     | ExcludeFromRemediation |
| 種類      | 文字列                    |
| ポータル表示名 | Defender の除外タグ         |

[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 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/devices/outphase-devices.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.
