Citrix Virtual Apps and Desktops connector
Nexthink Connector for Citrix Virtual Apps and Desktops (CVAD) retrieves important information about your CVAD environments, most notably the name of the Delivery Group to which the virtual machines belong.
This installation guide helps you install the connector securely. Your security team should review the installation steps described in this document and adjust them to meet your organization’s security policy.
Data imported into Nexthink
The connector populates the following fields of the virtualization grouping in the devices table.
virtualization.desktop_pool
string
The name of the Citrix Delivery Group the virtual machine belongs to.
virtualization.type
enumeration
The type of the desktop pool. Possible values are:
shared: several users work on the same virtual machine at the same time
personal: the virtual machine is used by one user at a time and all changes to the system persist
pooled: the device is used by one user at a time and during the logoff all changes including documents and data are erased.
virtualization.hostname
string
The name of the virtualization host where the virtual machine was last observed running.
virtualization.hypervisor_name
string
The hardware virtualization system running the virtual machine.
virtualization.environment_name
string
The name of the connector used to retrieve the virtualization details: the Name of the CVAD environment in the configuration file.
virtualization.desktop_broker
enumeration
The VDI broker platform of the virtual machine, citrix_cvad for this connector.
virtualization.disk_image
string
The disk image last observed in use by the virtual machine.
Nexthink connector server
To limit the risk of disrupting the Citrix Delivery Controller (also known as DDC), Nexthink recommends installing the Nexthink Connector for CVAD on a separate server.
For a proof of value, you can install the connector directly on the Delivery Controller, since its impact there is minimal.
Prerequisites
Nexthink Collector installed on the virtual machines of every CVAD environment, as described in Configuring and deploying Collector for VMs.
Installed Windows PowerShell 5.1.
Execution policy set to Bypass.
The following PowerShell modules, installed for the user account that runs the connector:
Installed Citrix PowerShell SDK 2203 LTSR or newer. Refer to the SDKs and APIs for Citrix Virtual Apps and Desktops 7 2203 LTSR documentation for the installation procedure using Citrix Studio.
The server where you install the connector is joined to the same Active Directory domain as your Citrix Delivery Controller, so the connector can sign in to Citrix with a domain user account.
The following accounts:
A local user account that runs the scheduled tasks, on the server where you install the connector.
A domain user account with the Citrix Read Only Administrator role, which the connector uses to read data from Citrix.
Hardware requirements
CPU
2-core x64
4-core x64
RAM
2 GB
4—8 GB
Free disk space
2 GB
5 GB
Operating system
Windows 10 / Server 2016
Windows 11 / Server 2022
Networking
The Nexthink Connector for CVAD connects to the Citrix Delivery Controller, the Citrix Director and your Nexthink instance.
The connector communicates with your Nexthink instance over TCP port 443.
The connector connects to the Citrix Director on TCP port 80.
The connector connects to the Delivery Controller on TCP port 80, or 443 if the controller uses HTTPS.
The following figure shows a simplified architecture with a connection between the connector and a Delivery Controller:
URLs to allow through the firewall or proxy for PowerShell Install-Module
PowerShell Gallery
https://www.powershellgallery.com
NuGet provider
https://www.nuget.org
NuGet API
https://api.nuget.org
CDN for packages
https://www.powershellgallery.com/api/v2/
Alternate NuGet V2 API
https://www.nuget.org/api/v2/
Certificate revocation
http://crl.microsoft.com
(normally optional; sometimes necessary)
Additional considerations
If SSL inspection is enabled on your proxy, ensure it does not break the TLS handshake.
If you're behind a proxy, set it in Settings > Network & Internet > Proxy while signed in as the local user account that runs the connector. The scheduled tasks cannot authenticate to a proxy, so allow connector traffic through without authentication. To install modules manually through an authenticating proxy, first run the following command in the same PowerShell window:
Test connectivity
You can test access using a PowerShell terminal by running the following command:
Local user account for scheduled tasks
The Nexthink Connector for CVAD runs as scheduled tasks, with one runner task per CVAD environment, and needs to be able to access the Citrix APIs. To limit security concerns, Nexthink recommends using a local user account on the server where you install the connector or a regular domain user account without any special privileges at the domain level.
The following guide uses the local user account on that server.
Log on as an administrator to the server that will run the Nexthink Connector for CVAD.
Launch the local users and groups console by running the command lusrmgr.msc from the start menu.

Right-click on the Users folder in the Local Users and Groups (Local) directory and select New user…
Create a user account according to your organization's naming conventions, for example nxt-ctx-connector-user. Make a note of the User name and Password: you need them to store credentials, to test the connector and to create the scheduled tasks.
To safeguard the functionality of the connector, select the following options:
User cannot change password
Password never expires

Click Create.
Open the local group policy editor by running gpedit.msc from the start menu.
Navigate to Computer Configuration > Windows Settings > Security Settings > Local Policies > User Rights Assignment and open the policy Log on as a batch job.
Click Add User or Group and add the user you created.

Installing the connector
Extract the zip file and copy the content of its CitrixConnector-<version> folder, the two scripts and the Config and Logs folders, to a folder on your system. Nexthink recommends the following folder:
C:\Program Files\Nexthink\Connectors\Citrix
Apply Modify permissions on the connector folder for the local user account you created earlier. The connector creates and writes to the Logs and Storage folders inside it.

Nexthink API credentials
The connector needs appropriate credentials to connect to the Nexthink Enrichment API. Nexthink stores the credentials safely in the credential store of the local user account you created earlier.
Create API credentials with the Enrichment API permission. Refer to the API credentials documentation for step-by-step guidance. When you save the API credentials, a window shows the Client ID and the Secret key. Make a note of both: they are not shown again once you close the window.

On the server that will run the Nexthink Connector for CVAD, open PowerShell as the local user account you created earlier with the runas command:

In the new PowerShell window, store the API credentials by running the following command:
Replace <Client ID> and <Secret key> with the values you noted down. The -Target value names the stored credential and is separate from the local user account name. Make a note of the TargetName you used with -Target: you need it for the configuration file.

Updating the configuration file
For the configuration file update, you need the URL of your Nexthink Cloud API instance. The URL pattern looks like this: instance.api.region.nexthink.cloud. See the steps listed below for more details.
Locate the folder where you unzipped the connector.
Navigate to the Config folder and open the config.json file using a text editor.
Scroll to the "NexthinkAPI" section:
Change the following values:
Replace the
"HostFQDN"value with the API address of your Nexthink instance,instance.api.region.nexthink.cloud:Replace
instancewith the name of the instance.Replace
regionwith one of the following regions:usfor the United Stateseufor the European Unionpacfor Asia-Pacificmetafor the Middle East, Turkey and Africa
For example:
gwy-eu-west-3-fuji-rest.api.eu.nexthink.cloud
Replace the
"WindowsCredentialEntry"value with theTargetNameof the API credentials you stored earlier, for example"WindowsCredentialEntry": "nxt-ctx-connector-credential",
Setting up a connection to a CVAD environment
The previous section described the basic configuration of the Nexthink Connector for CVAD. This section helps you set up a connection to a CVAD environment. Repeat the procedures in this section for every CVAD environment you need to connect to.
Citrix Delivery Controller
Nexthink Connector for CVAD connects to the Citrix Delivery Controller to retrieve data from the Monitor Service OData API of the Citrix Director and the Citrix PowerShell SDK. You need the Delivery Controller name to properly configure the connector.
Make a note of the fully qualified domain names (FQDN) of the Delivery Controller and of the server that hosts the Citrix Monitor Service API. Both can be the same server. You enter them later in Config\config.json, as CitrixControllerFQDN and CitrixDirectorFQDN in the entry of the environment under CitrixEnvironments.
Creating a read-only Citrix administrator
The Nexthink Connector for CVAD needs read-only access to the Citrix Director API and the Citrix PowerShell SDK. To do this, create a domain user account without any special privileges and make a note of the username and password.
Launch the Citrix Studio console and go to Configuration > Administration.
Right-click Administration and select Create Administrator.

Click Browse… and select the domain user account you created for the connector. Set the scope to All and click Next.

Select the Read Only Administrator role and click Next.

Select Enable administrator and click Finish.

Setting up stored credentials
Open PowerShell as the local user account, as described in Nexthink API credentials.
In the new PowerShell window, store the credentials of the domain user account with the Citrix Read Only Administrator role by running the following command:
Replace <domain\username> and <password> with the values of the domain user account. Make a note of the TargetName you used: you need it for the configuration file.

Updating the configuration file
Each CVAD environment has its own section in the configuration file. The configuration file that comes with the connector contains an example of how to configure multiple environments. If needed, create a copy of the original config.json file for future reference.
Locate the folder where you unzipped the connector.
Navigate to the Config folder and open the config.json file using a text editor.
Scroll to the "CitrixEnvironments" section. Keep one entry for each CVAD environment you connect to. If you connect to a single environment, remove the second entry, from { "Name": "<citrix-environment-name2>" to "WindowsCredentialEntry": "<citrix-user-credentials2>" }. The code should look similar to the following:
Change the following values in the entry:
Replace
<citrix-environment-name>with a name for this CVAD environment, for exampleCitrix Prod. You pass this name, in quotes, to the connector with-CitrixEnvironment.Replace
<citrix_controller_host>with the FQDN of the Delivery Controller.Replace
<citrix_director_host>with the FQDN of the Citrix Director.Replace
<citrix-user-credentials>with theTargetNameof the stored credentials you created earlier, for examplenxt-ctx-prod.
Testing the connector
Open PowerShell as the local user account, as described in Nexthink API credentials.
Change to the directory where you installed the connector, for example:
Run the Auto-Updater, which installs the connector module for the local user account:
Run the Runner for the environment:
Replace <environment-name> with the Name value of the environment in config.json, for example Citrix Prod.
The expected output for the Runner is 0, similar to the following figure:

Correct execution should provide a log such as the following:

The Runner writes the result of the test to Logs\<environment-name>\CitrixConnector-<yyyyMMdd>.log in the connector folder, for example C:\Program Files\Nexthink\Connectors\Citrix\Logs\Citrix Prod\.
Setting up the scheduled tasks
Create one scheduled task for the Runner of each CVAD environment, and one for the Auto-Updater.
Open the task scheduler and select Create task…

In the General tab, name the task, for example Nexthink CVAD connector - Citrix Prod, and change the user to the local user account you created earlier, for example nxt-ctx-connector-user. Select Run whether user is logged on or not.

In the Triggers tab, click New…. Under Advanced settings > Repeat task every, select 1 minute and set for a duration of to Indefinitely. Click OK. Each run sends only the machines powered on since the previous run and refreshes everything once an hour. A run is light, and the task must run at least hourly.

In the Actions tab, click New… and enter the following values. Click OK.
Program/script:
powershell.exeAdd arguments (optional):
-ExecutionPolicy Bypass -File "C:\Program Files\Nexthink\Connectors\Citrix\Citrix-Connector-Runner.ps1" -CitrixEnvironment "Citrix Prod", with the environment name fromconfig.jsonStart in (optional): the connector folder, for example
C:\Program Files\Nexthink\Connectors\Citrix

Click OK to save the task. When prompted, enter the password of the local user account and click OK.

Repeat these steps for each other CVAD environment, changing only the task name and the -CitrixEnvironment value.
Repeat these steps once for the Auto-Updater, with these differences:
Task name: for example
Nexthink CVAD connector - Auto-UpdaterTrigger: the same as the Runner, repeated every 15 minutes, so a new connector version is in use within 15 minutes.
Add arguments (optional):
-ExecutionPolicy Bypass -File "C:\Program Files\Nexthink\Connectors\Citrix\Citrix-Connector-Auto-Updater.ps1"
Verifying the data in Nexthink
After the first scheduled run of the Runner, open Investigations in Nexthink and run the query below. Each row is a virtual machine the connector enriched, with the environment that delivered it.
Where to go next
VDI Experience: the module Nexthink monitors virtual desktops with. The library pack below requires it.
Citrix CVAD essentials: a library pack to install from the Nexthink Library. Its dashboards track VM status, reboot health and Virtual Delivery Agent (VDA) registration. They also track the state of Delivery Controllers, license servers and StoreFront servers.
RELATED TOPIC
Last updated
Was this helpful?

