# Drain モードの切り替え

### 説明

この Runbooks は、Tenant のすべての AVD Hostpool を参照し、特定の Session Host の DrainMode を設定します。SubscriptionId の値は runbooks のカスタマイズで定義されている必要があります。

### 場所

Device → AVD → Drain Mode の切り替え

**ランブックの完全名**

rjgit-device\_AVD\_toggle-drain-mode

### アクセス許可

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

Azure: Hostpool を含む Subscription 上の Desktop Virtualization Host Pool Contributor

### パラメーター

#### DeviceName

Drain mode を切り替える対象となる AVD Session Host デバイスの名前。UI では非表示。

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

#### DrainMode

Drain Mode を有効または無効にするブール値。Drain Mode を有効にするには true に設定し（新しいセッションを防止）、無効にするには false に設定します（新しいセッションを許可）。既定値は false です。

| プロパティ | 値       |
| ----- | ------- |
| 必須    | true    |
| 既定値   | False   |
| 種類    | Boolean |

#### SubscriptionIds

AVD Session Host リソースが配置されている Azure サブスクリプション ID の配列。AVD.SubscriptionIds 設定（カスタマイズ）から取得されます。UI では非表示。

| プロパティ | 値         |
| ----- | --------- |
| 必須    | true      |
| 既定値   |           |
| 種類    | String\[] |

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


---

# Agent Instructions: 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/avd/toggle-drain-mode.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.
