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

# デバイスの廃止

### 説明

Windows デバイスを削除/段階的に廃止します。デバイスをワイプするか、Intune および AutoPilot から削除するかを選択できます。必要に応じて、Microsoft Defender for Endpoint でデバイスにタグを付け、修復対象外であることを示せます。注意: 除外タグはデバイスに適用されますが、ポータル経由で一度作成されて初めて、Defender ポータルの「Tags」フィルターに表示されます（Device > Manage tags > 「Create new tag」）。

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

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

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

#### 一度だけの設定: タグをフィルター可能にする

ポータルの **「タグ」** フィルターには残念ながら、ポータルで作成されたタグしか一覧表示されません。API のみで設定したタグはデバイスに付与され、デバイスページで表示されますが、 **一致** それだけでは「タグ」フィルターには表示されません。

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

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

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

### 場所

デバイス → 一般 → デバイスの段階的廃止

**完全な Runbook 名**

rjgit-device\_general\_outphase-device

### アクセス許可

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

* **種類**: Microsoft Graph
  * DeviceManagementManagedDevices.PrivilegedOperations.All
  * DeviceManagementManagedDevices.ReadWrite.All
  * DeviceManagementServiceConfig.ReadWrite.All
  * Device.Read.All
* **種類**: WindowsDefenderATP
  * Machine.Read.All
  * Machine.ReadWrite.All

#### RBAC ロール

* クラウド デバイス管理者

### パラメーター

#### デバイス ID

対象デバイスのデバイス ID。

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

#### intuneAction

実行する Intune のアクション（ワイプ、削除、またはなし）を決定します。

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

#### aadAction

実行する Entra ID (Azure AD) のアクション（削除、無効化、またはなし）を決定します。

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

#### wipeDevice

true に設定すると、Intune でワイプ操作がトリガーされます。

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

#### removeIntuneDevice

true に設定すると、Intune デバイス オブジェクトを削除します。

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

#### removeAutopilotDevice

「AutoPilot データベースからデバイスを削除しますか？」（最終値: true）または「デバイスを保持 / 気にしない」（最終値: false）を、実行するアクションとして選択できます。true に設定すると、runbook はデバイスを AutoPilot データベースから削除し、これによりデバイスはテナントを離脱できます。false に設定すると、デバイスは AutoPilot データベースに残り、テナント内の別のユーザー/デバイスに再割り当てできます。

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

#### removeAADDevice

「Entra ID からデバイスを削除しますか？」(最終値: true) または「デバイスを保持 / 気にしない」(最終値: false) を実行するアクションとして選択できます。true に設定すると、runbook は Entra ID (Azure AD) からデバイス オブジェクトを削除します。false に設定すると、デバイス オブジェクトは Entra ID (Azure AD) に残ります。

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

#### disableAADDevice

「Entra ID でデバイスを無効にしますか？」(最終値: true) または「デバイスを保持 / 気にしない」(最終値: false) を実行するアクションとして選択できます。true に設定すると、runbook は Entra ID (Azure AD) でデバイス オブジェクトを無効にします。false に設定すると、デバイス オブジェクトは Entra ID (Azure AD) で有効なままになります。

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

#### excludeFromDefender

true に設定すると、デバイスは指定された除外タグで Microsoft Defender for Endpoint にタグ付けされます。false に設定すると、Defender のステップは完全にスキップされます。

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

#### defenderExclusionTag

Microsoft Defender for Endpoint でデバイスに追加され、除外済みであることを示すタグ。既定値は "ExcludeFromRemediation" です。

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

[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:

```
GET https://docs.realmjoin.com/ja/zi-dong-hua/runbooks/runbook-references/device/general/outphase-device.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
