> For the complete documentation index, see [llms.txt](https://docs.scepman.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scepman.com/ja/zheng-ming-shu-guan-li/active-directory/shinario/rdp-sb.md).

# RDP サーバー証明書

次を使用する `RdpServer` テンプレートを使用すると、Remote Desktop Protocol を通じてアクセスするクライアントに提供される管理された証明書を利用するように、コンピューターとサーバーを構成できます。

{% stepper %}
{% step %}

### Active Directory でテンプレート オブジェクトを作成

証明書の登録とマッピングの間、 `SessionEnv` サービスは、証明書テンプレートがすでに構成済みの SCEPman の CEP サービスから使用される場合でも、Active Directory で構成された証明書テンプレートを検索します。この検索を満たすため、想定される場所に空の証明書テンプレート オブジェクトを作成します。これには、たとえば Enterprise Admin ロールを持つなど、Forest の Public Key Services コンテナーへの書き込み権限が必要です。

{% hint style="info" %}
このオブジェクトの作成には Enterprise Admin が必要です。Public Key Services コンテナーに追加のロール権限を割り当てている場合を除きます。
{% endhint %}

{% code lineNumbers="true" %}

```powershell
$ConfigPath = (Get-ADRootDSE).configurationNamingContext
$TemplateContainer = "CN=Certificate Templates,CN=Public Key Services,CN=Services,$ConfigPath"
$Name = "SCEPmanRdpServer"

New-ADObject -Name $Name `
             -Type pKICertificateTemplate `
             -Path $TemplateContainer `
             -OtherAttributes @{
                "displayName" = $Name;
                "msPKI-Cert-Template-OID" = "1.3.6.1.4.1.311.21.8.$(Get-Random 9999999).$(Get-Random 9999999)";
                "msPKI-Template-Schema-Version" = 1;
                "msPKI-Template-Minor-Revision" = 1;
                "msPKI-RA-Signature" = 0;
                "flags" = 0
             }
```

{% endcode %}
{% endstep %}

{% step %}

### SCEPman で証明書テンプレートを有効化

他の証明書テンプレートと同様に、これも SCEPman アプリ サービスに次の環境変数を追加することで構成できます:

| 設定                                              | 値        | 説明                                                  |
| ----------------------------------------------- | -------- | --------------------------------------------------- |
| AppConfig:ActiveDirectory:RdpServer:Enabled     | true     | 証明書テンプレートを有効にする                                     |
| AppConfig:ActiveDirectory:RdpServer:GroupFilter | グループ SID | オプション: このグループのメンバーのみが、このテンプレートを使用して証明書を登録できるようにします。 |
| {% endstep %}                                   |          |                                                     |

{% step %}

### グループ ポリシーを構成

グループ ポリシーでは、証明書テンプレート名を構成し、さらに接続時に特定のセキュリティ レイヤーを強制するようマシンに指示します。

<pre data-title="グループ ポリシー管理エディター (gpmc.msc) での設定場所"><code>コンピューターの構成

└-ポリシー
  └-管理用テンプレート
    └-Windows コンポーネント
      └-リモート デスクトップ サービス
        └-リモート デスクトップ セッション ホスト
          └-セキュリティ
<strong>            └-サーバー認証証明書テンプレート
</strong><strong>            └-リモート (RDP) 接続で特定のセキュリティ レイヤーの使用を要求する
</strong></code></pre>

#### サーバー認証証明書テンプレート

RDP サーバー認証に使用する証明書テンプレート名を入力します。既定では、これは `SCEPmanRdpServer`.

<figure><img src="/files/e7f22753c96dbed0d8a3ce81770fcaf848afd2c4" alt=""><figcaption></figcaption></figure>

#### リモート (RDP) 接続で特定のセキュリティ レイヤーの使用を要求する

ここで SSL を選択して、この証明書の使用を強制します。

<figure><img src="/files/a7c6e28b4dcc40674ed87a5202513ad967ed03b7" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

構成が整ったら、 `SessionEnv` サービスを再起動して、証明書の登録とマッピングを強制できます。

コンピューター上で、次のコマンドを実行して使用されている証明書を確認できます:

{% code overflow="wrap" %}

```powershell
(Get-CimInstance -Class Win32_TSGeneralSetting -Namespace root\cimv2\terminalservices -Filter "TerminalName='RDP-tcp'").SSLCertificateSHA1Hash
```

{% endcode %}

これにより、アクティブな RDP 証明書のサムプリントが出力されます。

イベント ログにも、新しい証明書が使用されたことが表示されます:

{% code title="関連するイベント ログ エントリを表示" overflow="wrap" %}

```powershell
Get-WinEvent -LogName "System" | Where-Object { $_.ProviderName -eq "Microsoft-Windows-TerminalServices-RemoteConnectionManager" } | Select-Object -First 10 | Format-List Message, TimeCreated
```

{% endcode %}

> RD セッション ホスト サーバーで Transport Layer Security (TLS) 1.0\Secure Sockets Layer (SSL)> \
> authentication and encryption に使用される、新しいテンプレート ベースの証明書がインストールされました。この> \
> 証明書の名前は svr01.Conitoso.local です。証明書の SHA1 ハッシュは> \
> イベント データに含まれています。


---

# 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.scepman.com/ja/zheng-ming-shu-guan-li/active-directory/shinario/rdp-sb.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.
