> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/inbound-connectors/connector-for-citrix-virtual-apps-and-desktops.md).

# Citrix Virtual Apps and Desktopsコネクタ

{% hint style="warning" %}
このドキュメントは外部ソースを参照しています。 Nexthink はサードパーティのドキュメントの正確性や、このページに記載されている情報に矛盾を生じさせる可能性のある外部の更新または変更を制御することはできません。エラーや矛盾を[Nexthink サポート](https://support.nexthink.com/)に報告してください。
{% endhint %}

Citrix Virtual Apps and Desktops（CVAD）用 Nexthink コネクターは、CVAD 環境に関する重要な情報、特に仮想マシンが属するデリバリー グループの名前を取得します。

このインストール ガイドは、コネクターを安全にインストールするのに役立ちます。セキュリティチームは、このドキュメントで説明されているインストール手順を確認し、組織のセキュリティポリシーに合わせて調整する必要があります。

## Nexthink にインポートされるデータ <a href="#connectorforcitrixvirtualappsanddesktops-devicefields" id="connectorforcitrixvirtualappsanddesktops-devicefields"></a>

コネクターは、[`devices`](https://docs.nexthink.com/platform/ja/understanding-key-data-platform-concepts/nql-data-model.md#device_device) テーブルの `virtualization` グループにある次のフィールドを設定します。

| Nexthinkフィールド                     | タイプ | 説明                                                                                                                                                                                                                                    |
| --------------------------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `virtualization.desktop_pool`     | 文字列 | 仮想マシンが属する Citrix デリバリー グループの名前。                                                                                                                                                                                                       |
| `virtualization.type`             | 列挙型 | <p>デスクトッププールの種類。</p><p>可能な値は次のとおりです。</p><ul><li>shared: 複数のユーザーが同時に同じ仮想マシンで作業します</li><li>personal: 仮想マシンは一度に1人のユーザーによって使用され、システムに対するすべての変更が保持されます</li><li>pooled: デバイスは一度に1人のユーザーによって使用され、ログオフ時にドキュメントやデータを含むすべての変更が消去されます。</li></ul> |
| `virtualization.hostname`         | 文字列 | 仮想マシンが最後に実行されていることが確認された仮想化ホストの名前。                                                                                                                                                                                                    |
| `virtualization.hypervisor_name`  | 文字列 | 仮想マシンを実行しているハードウェア仮想化システム。                                                                                                                                                                                                            |
| `virtualization.environment_name` | 文字列 | 仮想化の詳細の取得に使用されるコネクターの名前: 設定ファイル内の CVAD 環境の `Name`。                                                                                                                                                                                    |
| `virtualization.desktop_broker`   | 列挙型 | 仮想マシンの VDI ブローカー プラットフォーム。このコネクターでは `citrix_cvad`。                                                                                                                                                                                    |
| `virtualization.disk_image`       | 文字列 | 仮想マシンで最後に使用されていることが確認されたディスク イメージ。                                                                                                                                                                                                    |

## Nexthink コネクタサーバー <a href="#connectorforcitrixvirtualappsanddesktops-nexthinkconnectorserver" id="connectorforcitrixvirtualappsanddesktops-nexthinkconnectorserver"></a>

Citrix Delivery Controller（DDC とも呼ばれます）への影響のリスクを抑えるため、Nexthink では Nexthink Connector for CVAD を別のサーバーにインストールすることを推奨しています。

価値実証のために、Delivery Controller への影響は最小限であるため、コネクターを直接インストールできます。

### 前提条件 <a href="#connectorforcitrixvirtualappsanddesktops-prerequisites" id="connectorforcitrixvirtualappsanddesktops-prerequisites"></a>

* [VM 向け Collector の設定と展開](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/deploying-nexthink-in-non-vdi-environment/installing-collector/installing-collector-on-windows/configuring-and-deploying-collector-for-vms.md)で説明されているように、各 CVAD 環境の仮想マシンにインストールされた Nexthink Collector。
* インストールされている Windows PowerShell 5.1。
* 実行ポリシーが **Bypass** に設定されていること。
* コネクターを実行するユーザーアカウントにインストールされた、以下の PowerShell モジュール:
  * [Logging 4.8.5](https://www.powershellgallery.com/packages/Logging/4.8.5)
  * [CredentialManager 2.0](https://www.powershellgallery.com/packages/CredentialManager/2.0)
* Citrix PowerShell SDK 2203 LTSR 以降がインストールされていること。インストール手順については、[SDKs and APIs for Citrix Virtual Apps and Desktops 7 2203 LTSR](https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/2203-ltsr/sdk-api.html) のドキュメントを参照。
* コネクターをインストールするサーバーが Citrix Delivery Controller と同じ Active Directory ドメインに参加しており、コネクターがドメインユーザーアカウントで Citrix にサインインできること。
* [Nexthink Connector for CVAD をダウンロード済み](https://download.nexthink.com/integrations/Citrix+OnPrem+Connector/1.7.12/CitrixConnector-1.7.12.zip)。
* 必要なアカウント:
  * コネクターをインストールするサーバー上で、スケジュールされたタスクを実行するローカルユーザーアカウント。
  * コネクターが Citrix からデータを読み取るために使用する、Citrix の **Read Only Administrator** ロールを持つドメインユーザーアカウント。

### ハードウェア要件

| コンポーネント      | 最小人数                     | 推奨人数                     |
| ------------ | ------------------------ | ------------------------ |
| CPU          | 2 コア x64                 | 4 コア x64                 |
| RAM          | 2 GB                     | 4～8 GB                   |
| ディスクの空き容量    | 2 GB                     | 5 GB                     |
| オペレーティングシステム | Windows 10 / Server 2016 | Windows 11 / Server 2022 |

### ネットワーキング <a href="#connectorforcitrixvirtualappsanddesktops-networking" id="connectorforcitrixvirtualappsanddesktops-networking"></a>

Nexthink Connector for CVAD は、Citrix Delivery Controller、Citrix Director、および Nexthink インスタンスに接続します。

* コネクターは TCP ポート 443 経由で Nexthink インスタンスと通信します。
* コネクタは、TCP ポート 80 経由で Citrix Director に接続します。
* コネクタは、TCP ポート 80 経由で Delivery Controller に接続します。コントローラーが HTTPS を使用する場合は、ポート 443 を使用します。

次の図は、コネクタと Delivery Controller 間の接続を含む簡略化されたアーキテクチャを示しています。

```mermaid
%%{ init : { "theme" : "default", "flowchart" : { "curve" : "linear" }}}%%
flowchart BT
  subgraph domain["クライアント ドメイン"]
    ddc["デリバリー コントローラー"]
    dir["ディレクター"]
    nxt["Nexthink<br/>インスタンス"]
    subgraph machine["マシン"]
      conn["コネクタ"]
    end
  end
  conn -.->|"PowerShell"| ddc
  conn -.->|"REST"| dir
  conn -.->|"REST"| nxt
  linkStyle 0 stroke:#1046A8,stroke-dasharray:8 6;
  linkStyle 1,2 stroke:#1046A8,stroke-dasharray:2 4;
  classDef start    fill:#EEF3F7,stroke:#1046A8,color:#221F20;
  classDef process  fill:#3194F7,stroke:#1046A8,color:#FFFFFF;
  class ddc,dir,conn start;
  class nxt process;
```

#### PowerShell `Install-Module` でファイアウォールまたはプロキシを通過させる必要がある URL

<table><thead><tr><th width="319">目的</th><th>URL</th></tr></thead><tbody><tr><td>PowerShell ギャラリー</td><td><code>[Workflows APIの概要](https://www.powershellgallery.com)</code></td></tr><tr><td>NuGet プロバイダー</td><td><code>[Workflows APIの概要](https://www.nuget.org)</code></td></tr><tr><td>NuGet API</td><td><code>[Workflows APIの概要](https://api.nuget.org)</code></td></tr><tr><td>パッケージのための CDN</td><td><code>https://www.powershellgallery.com/api/v2/を参照してください</code></td></tr><tr><td>代替 NuGet V2 API</td><td><code>https://www.nuget.org/api/v2/を参照してください</code></td></tr><tr><td>証明書失効</td><td><code>http://crl.microsoft.com</code><br>（通常はオプションですが、場合によっては必要です）</td></tr></tbody></table>

#### 追加の考慮事項

* プロキシで SSL インスペクションが有効になっている場合は、TLS ハンドシェイクが妨げられないことを確認してください。
* プロキシの背後にいる場合は、コネクタを実行するローカルユーザーアカウントでサインインしている間に、*設定 > ネットワークとインターネット > プロキシ* で設定してください。スケジュールされたタスクはプロキシに対して認証できないため、認証なしでコネクタのトラフィックを通過させてください。認証が必要なプロキシ経由でモジュールを手動でインストールするには、まず同じ PowerShell ウィンドウで次のコマンドを実行します。

{% code overflow="wrap" %}

```powershell
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
```

{% endcode %}

#### 接続をテスト

次のコマンドを実行し、PowerShell ターミナルを使用してアクセスをテストできます:

```powershell
Invoke-WebRequest https://www.powershellgallery.com
```

### スケジュールされたタスク用のローカルユーザーアカウント <a href="#connectorforcitrixvirtualappsanddesktops-serviceaccountforscheduledtasks" id="connectorforcitrixvirtualappsanddesktops-serviceaccountforscheduledtasks"></a>

CVAD 用 Nexthink Connector はスケジュールされたタスクとして実行され、CVAD 環境ごとにランナータスクがあり、Citrix API にアクセスできる必要があります。セキュリティ上の懸念を最小限に抑えるため、Nexthink は、コネクタをインストールするサーバー上のローカルユーザーアカウント、またはドメインレベルで特別な権限を持たない通常のドメインユーザーアカウントを使用することを推奨します。

以下のガイドでは、そのサーバー上のローカルユーザーアカウントを使用します。

{% stepper %}
{% step %}
Nexthink Connector for CVAD を実行するサーバーに管理者としてログオンします。
{% endstep %}

{% step %}
スタートメニューから `lusrmgr.msc` コマンドを実行して、ローカル ユーザーとグループのコンソールを起動します。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-e33a79105f0d5b3d5de897a63c6ac9bb729684d0%2Fcitr-1678980898.png?alt=media" alt="Run the lusrmgr.msc command" width="306"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**ローカル ユーザーとグループ (ローカル)** ディレクトリ内の **Users** フォルダーを右クリックし、**新しいユーザー…** を選択します。
{% endstep %}

{% step %}
組織の命名規則に従ってユーザーアカウントを作成します。例：`nxt-ctx-connector-user`。**ユーザー名**と**パスワード**を控えておいてください。認証情報の保存、コネクタのテスト、およびスケジュールされたタスクの作成に必要です。

コネクタの機能を保護するために、次のオプションを選択します。

* **ユーザーはパスワードを変更できません**
* **パスワードは有効期限がありません**

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-bc70b97581f4545c71afe2f5cf02d09ff1b92fb0%2Fcitr-1678981225.png?alt=media" alt="New user options" width="340"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**作成**をクリックします。
{% endstep %}

{% step %}
スタートメニューから `gpedit.msc` を実行して、ローカル グループ ポリシー エディターを開きます。
{% endstep %}

{% step %}
*コンピューターの構成 > Windows の設定 > セキュリティの設定 > ローカル ポリシー > ユーザー権利の割り当て* に移動し、**バッチ ジョブとしてログオン**ポリシーを開きます。
{% endstep %}

{% step %}
**ユーザーまたはグループの追加**をクリックし、作成したユーザーを追加します。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-59f156d1c2eac213529b240862e92eb49c95e6e4%2Fcitr-1678981506.png?alt=media" alt="Add user or group" width="374"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### コネクタのインストール <a href="#connectorforcitrixvirtualappsanddesktops-installingtheconnector" id="connectorforcitrixvirtualappsanddesktops-installingtheconnector"></a>

{% stepper %}
{% step %}
[Nexthink Connector for CVAD をダウンロードします](#connectorforcitrixvirtualappsanddesktops-prerequisites)。
{% endstep %}

{% step %}
zip ファイルを展開し、その `CitrixConnector-<version>` フォルダーの内容、二つのスクリプト、**Config** フォルダーおよび **Logs** フォルダーを、システム上のフォルダーにコピーします。 Nexthink では、次のフォルダーを推奨します。

`C:\Program Files\Nexthink\Connectors\Citrix`
{% endstep %}

{% step %}
先ほど作成したローカルユーザーアカウントに、コネクタフォルダーの**変更**アクセス許可を適用します。コネクタは、その中にある `Logs` フォルダーおよび `Storage` フォルダーを作成し、そこに書き込みます。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-c9b0c0a376dea0265e80ad97108033c0527f927a%2Fcitr-1678982114.png?alt=media" alt="Folder properties, Security tab, with Modify permission granted to the local user account" width="374"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Nexthink API 認証情報

コネクタが Nexthink Enrichment API に接続するには、適切な認証情報が必要です。 Nexthink は、以前に作成したローカルユーザーアカウントの資格情報ストアに安全に認証情報を保管します。

{% stepper %}
{% step %}
**Enrichment API** 権限を持つ API 認証情報を作成します。手順については、[API 認証情報](https://developer.nexthink.com/docs/api/api-credentials)のドキュメントを参照してください。 API 認証情報を保存すると、クライアント ID とシークレットキーを示すウィンドウが表示されます。両方を控えておいてください。ウィンドウを閉じると、再び表示されることはありません。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-25527dad3aca35423e85a92c8f2bcd90999443c5%2Fcitr-1679044299.png?alt=media" alt="OAuth client credentials" width="374"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Nexthink Connector for CVAD を実行するサーバーで、先ほど作成したローカルユーザーアカウントとして、`runas` コマンドを使用して PowerShell を開きます。

```powershell
runas /user:nxt-ctx-connector-user powershell.exe
```

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-4071de583e2fbe2aee263a36c79648a5fc2a85c0%2Fcitr-1679044505.png?alt=media" alt="runas CLI" width="578"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
新しい PowerShell ウィンドウで、次のコマンドを実行して API 認証情報を保存します。

{% code overflow="wrap" %}

```powershell
New-StoredCredential -Target "nxt-ctx-connector-credential" -UserName "<Client ID>" -Password "<Secret key>" -Persist LocalMachine
```

{% endcode %}

`<Client ID>` と `<Secret key>` を、控えた値に置き換えます。 `-Target` 値は保存される資格情報の名前を指定するものであり、ローカルユーザーアカウント名とは別のものです。 `-Target` で使用した `TargetName` を控えておいてください。設定ファイルで必要です。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-66cc57132cbd7553fbe1391f0bfa2223808152de%2Fcitr-1679044919.png?alt=media" alt="PowerShell window"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
`config.json` の [構成ファイル](#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile)には、`"NexthinkAPI"` にこれらの資格情報を保存しています。

-Target で使用した `TargetName` は、`"WindowsCredentialEntry"` に保存されます。
{% endhint %}

### 構成ファイルの更新 <a href="#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile" id="connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile"></a>

構成ファイルの更新には、Nexthink クラウド API インスタンスの URL が必要です。 URL パターンは次のようになります: `instance.api.region.nexthink.cloud`。詳しい手順は、以下のステップを参照してください。

{% hint style="info" %}
特定のリージョンを知らない場合は、Nexthink の担当者に連絡して情報を入手してください。
{% endhint %}

{% stepper %}
{% step %}
コネクタを展開したフォルダーを見つけます。
{% endstep %}

{% step %}
**Config** フォルダーに移動し、テキストエディターを使用して `config.json` ファイルを開きます。
{% endstep %}

{% step %}
`"NexthinkAPI"` セクションまでスクロールします。

```json
{
    "_Info": "This is the JSON based configuration for Citrix Virtual Apps and Desktops connector",
    "Info": {
        "Project": "copla-citrix-onprem-connector",
        "ConfigVersion": "1.1.0"
    },
    "Logging": {
        "LogRetentionDays": 7,
        "LogLevel": "INFO"
    },
    "CitrixEnvironments": [
        {
            "Name": "<citrix-environment-name>",
            "CitrixControllerFQDN": "<citrix_controller_host>",
            "CitrixDirectorFQDN": "<citrix_director_host>",
            "WindowsCredentialEntry": "<citrix-user-credentials>"
        },
        {
            "Name": "<citrix-environment-name2>",
            "CitrixControllerFQDN": "<citrix_controller_host2>",
            "CitrixDirectorFQDN": "<citrix_director_host2>",
            "WindowsCredentialEntry": "<citrix-user-credentials2>"
        }
    ],
    "NexthinkAPI": {
        "HostFQDN": "<nexthink_api_host>",
        "WindowsCredentialEntry": "<nxt-citrix-credentials>",
        "RequestBatchSize": "1000"
    }
}
```

次の値を変更します。

* `"HostFQDN"` の値を、Nexthink インスタンスの API アドレス `instance.api.region.nexthink.cloud` に置き換えます。
  * `instance` をインスタンス名に置き換えます。
  * `region` を次のいずれかのリージョンに置き換えます。
    * `us` はアメリカ合衆国を表します
    * `eu` は欧州連合を表します
    * `pac` はアジア太平洋を表します
    * `meta` は中東、トルコ、アフリカを表します
  * 例：`gwy-eu-west-3-fuji-rest.api.eu.nexthink.cloud`
* `"WindowsCredentialEntry"` の値を、先ほど保存した API 認証情報の `TargetName` に置き換えます。例：`"WindowsCredentialEntry": "nxt-ctx-connector-credential",`
  {% endstep %}
  {% endstepper %}

{% hint style="warning" %}
設定ファイルの `"CitrixEnvironments"` 値を置き換え、CVAD 環境への接続を設定するには、[#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile.1](#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile.1 "mention") を参照してください。
{% endhint %}

## CVAD 環境への接続の設定 <a href="#connectorforcitrixvirtualappsanddesktops-settingupaconnectiontothecvadfarm" id="connectorforcitrixvirtualappsanddesktops-settingupaconnectiontothecvadfarm"></a>

前のセクションでは、Nexthink コネクタの基本構成について説明しました。このセクションでは、CVAD 環境への接続を設定する方法について説明します。接続が必要なすべての CVAD 環境について、このセクションの手順を繰り返します。

### Citrix デリバリー コントローラー <a href="#connectorforcitrixvirtualappsanddesktops-citrixdesktopdeliverycontroller-ddc" id="connectorforcitrixvirtualappsanddesktops-citrixdesktopdeliverycontroller-ddc"></a>

Nexthink Connector for CVAD は、Citrix Director の Monitor Service OData API および Citrix PowerShell SDK からデータを取得するために、Citrix Delivery Controller に接続します。コネクタを正しく構成するには、Delivery Controller の名前が必要です。

Delivery Controller と、Citrix Monitor Service API をホストするサーバーの完全修飾ドメイン名（FQDN）を控えておいてください。両方が同じサーバーである場合もあります。後で、`CitrixEnvironments` の環境エントリ内の `CitrixControllerFQDN` および `CitrixDirectorFQDN` として、`Config\config.json` に入力します。

### 読み取り専用の Citrix 管理者の作成 <a href="#connectorforcitrixvirtualappsanddesktops-creatingaread-onlycitrixadministrator" id="connectorforcitrixvirtualappsanddesktops-creatingaread-onlycitrixadministrator"></a>

Nexthink コネクタは、Citrix Director API と Citrix PowerShell SDK への読み取り専用アクセスを必要とします。これを行うには、特別な権限を持たないドメインユーザーアカウントを作成し、ユーザー名とパスワードを控えておきます。

{% stepper %}
{% step %}
Citrix Studio コンソールを起動し、*構成 > 管理* に移動します。
{% endstep %}

{% step %}
**管理**を右クリックし、**管理者の作成**を選択します。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-748b2c74fd1ebe4aa6dbac6618e3a56c316e0da8%2Fcitr-1669301721.png?alt=media" alt="Create Administrator" width="374"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**参照…をクリックし、コネクタ用に作成したドメインユーザーアカウントを選択します。スコープをすべて**に設定し、**次へ**をクリックします。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-98a2ba5c73f12ec9994be85c299eeab5abb3ae9a%2Fcitr-1669301896.png?alt=media" alt="Scope"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**読み取り専用管理者**ロールを選択し、**次へ**をクリックします。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-62d3e63582a44e873cbdfaace494ab04d6f3a291%2Fcitr-1669301951.png?alt=media" alt="Read only administrator"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**管理者を有効にする**を選択し、**完了**をクリックします。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-a59ee7629430abbe7f01394cac377372fee6869e%2Fcitr-1669302227.png?alt=media" alt="Enable administrator"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### 保存済み資格情報の設定 <a href="#connectorforcitrixvirtualappsanddesktops-settingupstoredcredentials" id="connectorforcitrixvirtualappsanddesktops-settingupstoredcredentials"></a>

{% stepper %}
{% step %}
[Nexthink API 認証情報](#nexthink-api-credentials)で説明しているとおり、ローカルユーザーアカウントとして PowerShell を開きます。
{% endstep %}

{% step %}
新しい PowerShell ウィンドウで、次のコマンドを実行して、Citrix 読み取り専用管理者ロールを持つドメインユーザーアカウントの認証情報を保存します。

{% code overflow="wrap" %}

```powershell
New-StoredCredential -Target "nxt-ctx-prod" -UserName "<domain\username>" -Password "<password>" -Persist LocalMachine
```

{% endcode %}

`<domain\username>` と `<password>` を、ドメインユーザーアカウントの値に置き換えます。使用した `TargetName` を必ず控えておいてください。この値は設定ファイルで必要になります。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-18d8fc9ff5ba47ef0cfcab72995f17b74dee5c78%2Fimage-20230413-133931.png?alt=media" alt="PowerShell window"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
設定ファイル `config.json` [(説明 ファイル)](#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile.1) では、`CitrixEnvironments` にこれらの資格情報が保存されます。

`-Target` と一緒に使用した `TargetName` は、`WindowsCredentialEntry` に保存されます。
{% endhint %}

### 構成ファイルの更新 <a href="#connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile.1" id="connectorforcitrixvirtualappsanddesktops-updatingtheconfigurationfile.1"></a>

各 CVAD 環境には構成ファイルに独自のセクションがあります。コネクタに付属の構成ファイルには、複数の環境を設定する方法の例が含まれています。必要に応じて、将来の参照のために元の `config.json` ファイルをコピーします。

{% stepper %}
{% step %}
コネクタを解凍したフォルダーを見つけます。
{% endstep %}

{% step %}
**Config** フォルダーに移動し、テキストエディターを使用して `config.json` ファイルを開きます。
{% endstep %}

{% step %}
`"CitrixEnvironments"` セクションまでスクロールします。接続する各 CVAD 環境のエントリを保持します。単一の環境に接続する場合は、`{ "Name": "<citrix-environment-name2>"` から `"WindowsCredentialEntry": "<citrix-user-credentials2>" }` までの後者のエントリを削除します。コードは次のようになるはずです：

<pre class="language-json"><code class="lang-json">{
    "_Info": "これは Citrix Virtual Apps and Desktops コネクタ用の JSON ベースの設定です",
    "Info": {
        "Project": "copla-citrix-onprem-connector",
        "ConfigVersion": "1.1.0"
    },
    "Logging": {
        "LogRetentionDays": 7,
        "LogLevel": "INFO"
    },
    "CitrixEnvironments": [
        {
            "Name": "",
            "CitrixControllerFQDN": "",
            "CitrixDirectorFQDN": "",
            "WindowsCredentialEntry": <a data-footnote-ref href="#user-content-fn-1">"nxt-ctx-prod"</a>
        }
    ],
    "NexthinkAPI": {
        "HostFQDN": "",
        "WindowsCredentialEntry": "nxt-ctx-connector-credential",
        "RequestBatchSize": "1000"
    }
}
</code></pre>

{% endstep %}

{% step %}
エントリ内の次の値を変更します。

* `<citrix-environment-name>` を、この CVAD 環境の名前に置き換えます。たとえば `Citrix Prod` を使用します。この名前を引用符で囲み、`-CitrixEnvironment` を使用してコネクタに渡します。
* `<citrix_controller_host>` を Delivery Controller の FQDN に置き換えます。
* `<citrix_director_host>` を Citrix Director の FQDN に置き換えます。
* `<citrix-user-credentials>` を、前に作成した格納済み資格情報の `TargetName` に置き換えます。たとえば `nxt-ctx-prod` を使用します。
  {% endstep %}
  {% endstepper %}

### コネクタのテスト <a href="#connectorforcitrixvirtualappsanddesktops-testingtheconnector" id="connectorforcitrixvirtualappsanddesktops-testingtheconnector"></a>

{% stepper %}
{% step %}
[Nexthink API 資格情報](#nexthink-api-credentials)で説明されているように、ローカルユーザーアカウントとして PowerShell を開きます。
{% endstep %}

{% step %}
コネクタをインストールしたディレクトリに移動します。例:

```powershell
cd 'C:\Program Files\Nexthink\Connectors\Citrix\'
```

{% endstep %}

{% step %}
ローカルユーザーアカウント用のコネクタモジュールをインストールする Auto-Updater を実行します。

```powershell
.\Citrix-Connector-Auto-Updater.ps1
```

{% endstep %}

{% step %}
環境の Runner を実行します。

```powershell
.\Citrix-Connector-Runner.ps1 -CitrixEnvironment "<environment-name>"
```

`<environment-name>` を、`config.json` 内の環境の `Name` 値に置き換えます。たとえば `Citrix Prod` を使用します。
{% endstep %}
{% endstepper %}

Runner の想定される出力は、次の図に示すように `0` です。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-a11cfc37154e9534b903d9d2be22181f48883c28%2Fimage%20(840).png?alt=media" alt="Script output"><figcaption></figcaption></figure>

正しく実行されれば、次のようなログが生成されるはずです：

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-99b6224671d86f1f0597b3deadc9f2ef6e395288%2Fimage%20(841).png?alt=media" alt="Script execution log"><figcaption></figcaption></figure>

Runner は、テスト結果をコネクタフォルダー内の `Logs\<environment-name>\CitrixConnector-<yyyyMMdd>.log` に書き込みます。たとえば `C:\Program Files\Nexthink\Connectors\Citrix\Logs\Citrix Prod\` です。

### スケジュールされたタスクの設定 <a href="#connectorforcitrixvirtualappsanddesktops-settingupascheduledtask" id="connectorforcitrixvirtualappsanddesktops-settingupascheduledtask"></a>

各 CVAD 環境の Runner 用にスケジュールされたタスクを作成し、Auto-Updater 用にも作成します。

{% stepper %}
{% step %}
タスクスケジューラを開き、\*\*タスクの作成… \*\*を選択します

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-e4cdd40df98d68e566780ee02b2ecd8127017101%2Fcitr-1669383499.png?alt=media" alt="Create a task" width="306"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**全般** タブで、タスクに名前を付けます。たとえば `Nexthink CVAD connector - Citrix Prod` を使用します。次に、ユーザーを前に作成したローカルユーザーアカウントに変更します。たとえば `nxt-ctx-connector-user` を使用します。**ユーザーがログオンしているかどうかにかかわらず実行** を選択します。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-781c005287fa11ef72510be74aad6c9c76b376c4%2Fcitr-1679385360.png?alt=media" alt="Citrix PROD connector properties" width="544"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**トリガー** タブで、**新規…** をクリックします。*詳細設定 > タスクを繰り返す間隔* で **1 分** を選択し、**継続時間** を **無期限** に設定します。 **OK**をクリックします。各実行では前回の実行以降に起動したマシンのみが送信され、すべての情報が毎時更新されます。実行時の負荷は軽く、タスクは少なくとも毎時実行する必要があります。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-ec49cc2e845d1230fd015ff9b4117ac4ffd1ce03%2Fimage%20(910).png?alt=media" alt="New trigger, repeating the task every minute indefinitely" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**操作** タブで、**新規…** をクリックし、次の値を入力します。 **OK**をクリックします。

* **プログラム/スクリプト**: `powershell.exe`
* **引数の追加（オプション）**: `-ExecutionPolicy Bypass -File "C:\Program Files\Nexthink\Connectors\Citrix\Citrix-Connector-Runner.ps1" -CitrixEnvironment "Citrix Prod"`、`config.json` の環境名を指定
* **開始（オプション）**: コネクタフォルダー、たとえば `C:\Program Files\Nexthink\Connectors\Citrix`

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-b39ad1dcc25eb3e105661c61b283fe920d140462%2Fcitr-1670319737.png?alt=media" alt="Edit action" width="476"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**OK** をクリックしてタスクを保存します。メッセージが表示されたら、ローカルユーザーアカウントのパスワードを入力し、**OK** をクリックします。

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-b34805f1e6808fd75ff8560bfcb6f7f97958b03b%2Fcitr-1679387044.png?alt=media" alt="Confirm credentials" width="306"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
他の CVAD 環境ごとにこれらの手順を繰り返し、タスク名と `-CitrixEnvironment` 値のみを変更します。
{% endstep %}

{% step %}
以下の相違点を除き、Auto-Updater に対してもこれらの手順を繰り返します。

* タスク名: 例: `Nexthink CVAD connector - Auto-Updater`
* トリガー: Runner と同じですが、15 分ごとに繰り返します。これにより、新しいコネクタバージョンが 15 分以内に使用されます。
* **引数の追加（オプション）**: `-ExecutionPolicy Bypass -File "C:\Program Files\Nexthink\Connectors\Citrix\Citrix-Connector-Auto-Updater.ps1"`
  {% endstep %}
  {% endstepper %}

## Nexthink でのデータの確認

Runner の最初のスケジュール実行後、Nexthink で **Investigations** を開き、以下のクエリを実行します。各行は、コネクタによって拡充された仮想マシンと、それを配信した環境を示します。

```
devices
| where device.virtualization.desktop_broker == citrix_cvad
| list device.name, device.virtualization.environment_name, device.virtualization.desktop_pool, device.virtualization.type, device.virtualization.hostname, device.virtualization.hypervisor_name, device.virtualization.disk_image
```

## 次のステップ

* [VDI Experience](https://docs.nexthink.com/platform/ja/user-guide/vdi-experience.md): Nexthink が仮想デスクトップを監視するために使用するモジュールです。以下のライブラリパックにはこれが必要です。
* [Citrix CVAD essentials](https://docs.nexthink.com/platform/ja/library-packs/vdi/citrix/citrix-cvad-essentials.md): Nexthink Library からインストールするライブラリパックです。ダッシュボードでは、VM のステータス、再起動の正常性、および Virtual Delivery Agent（VDA）の登録を追跡します。また、Delivery Controller、ライセンスサーバー、StoreFront サーバーの状態も追跡します。

***

関連トピック

* [API 資格情報](https://developer.nexthink.com/docs/api/api-credentials)
* [VM 用 Collector の設定とデプロイ](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/deploying-nexthink-in-non-vdi-environment/installing-collector/installing-collector-on-windows/configuring-and-deploying-collector-for-vms.md)
* [VDI Experience](https://docs.nexthink.com/platform/ja/user-guide/vdi-experience.md)
* [Citrix CVAD の基本事項](https://docs.nexthink.com/platform/ja/library-packs/vdi/citrix/citrix-cvad-essentials.md)

[^1]: この値は `New-StoredCredential -Target` のパラメーターに一致している必要があります。


---

# 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.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/inbound-connectors/connector-for-citrix-virtual-apps-and-desktops.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.
