# Using the agent in a Virtual Desktop Infrastructure

When using Snow Inventory Agent for Windows in a Virtual Desktop Infrastructure (VDI), some configuration settings must be applied to ensure accurate capture of all activities on each virtual desktop.

## VDI awareness

To utilize the functionality for VDI and VDA license calculations in Snow License Manager, the computer needs to be aware that it is a part of a VDI. This is achieved by using a system setting in the configuration file:

env.is_virtual_desktop_infrastructure=true

Typically this configuration is set during the creation of the MSI package but can also be modified after deployment using the Snow Inventory Admin Console.

## Agent installation

The Snow Inventory Agent must be installed on all virtual desktops. This can be achieved either by installing the agent in the golden image (the archetypical version of a cloned disk), or by deploying it as a part of a VDI provisioning process.

## Capture assurance

For VDI environments—particularly for non-persistent VDI environments—Snow Software recommends performing at least two scan actions:

1. Schedule a full scan after the VDI instance is started and has all relevant software deployed to it; for this purpose, it is possible to use the Snow Inventory Agent scheduler or any alternative method to run the following command, as described in Initiate a scan of online computers:

sc.exe control SnowInventoryAgent5 128
2. Execute one or more aggregations and sendings of metering data by running the following command, as described in Initiate a scan of online computers:

sc.exe control SnowInventoryAgent5 132

### Note

This command can be included in a script, for example, the Windows logoff script or in the shutdown script for the VDI instance.

To ensure that all VDI sessions and application usage within the VDI are captured, a script needs to be executed as a part of closing down the Virtual Desktop session. The script will trigger the scan and send the result to a Snow Inventory Server before allowing the session to terminate. Depending on what infrastructure the VDI is running on, different solutions exist for running scripts as a part of the VDI decommission. Be aware that the sc command is asynchronous; Snow Software recommends implementing logic that allows the sc task to finish before shutting down/logging off. For more information, contact Snow Support.