Citrix Virtual Delivery Agent (VDA) Post Install Script

Updated 18th July 2025

Whilst some of these items can be excluded from the Virtual Delivery Agent (VDA) installation, checking and managing them in a post install script ensures we have consistency between all installations and VDA versions. All these actions need to take place in the base image, hence why they are managed in a script and not via Group Policies. This script has been built from years of lessons learnt and developing best practices. It will…

  • Disable the Telemetry Service
  • Disable the VDA Ceip Service
  • Disable the CtxAppVService (from 7.14 to 7.15 CU4/1906)
  • Disable the App-V Package Cleanup (from 7.15 CU5/1909)
  • Disable the Smart Card Services and Launcher
  • Implement the Citrix Desktop Service (BrokerAgent) Scheduled Task
  • Configure the UviProcessExcludes
  • Configure the CtxHooks
  • Configure the UPMEvent
  • Update the BrokerAgent.exe.config file
  • Enable the SaveRsopToFile registry value if it exists

Read more

Best Practice for the Windows Client Side Caching (CSC) kernel driver in VDI workloads

It’s been a best practice for a long time to disable Offline Files in both RDSH and VDI workloads. However, this has only ever been based around the Offline Files (CscService) service and some registry tweaks.

What people don’t realize is that you must properly disable Offline Files in all VDI workloads by also disabling the Windows Client Side Caching (CSC) kernel driver as outlined by Ned Pyle here.

Even with the Offline Files (CscService) service disabled, the Windows Client Side Caching (CSC) kernel driver is still loaded at Windows startup, creating unnecessary noise and potentially impeding performance when users access a network share.

The following example is a screen shot of Process Monitor monitoring a zpaq64.exe process extracting a file to a network drive. Note how it’s continually attempting to access the CSC (Client-Side Caching) area before the network share, even though Offline Files is disabled. This creates a large number of NAME NOT FOUND errors, and adds a potential delay to the execution time.

Read more

Best Practice for the Windows Time (W32TIME) Service for RDSH and VDI workloads

When using image deployment mechanisms for RDSH and VDI workloads, such as Citrix PVS, Citrix MCS and VMware View Composer, it’s extremely important to reconfigure the Windows Time (w32time) Service to ensure that the LastBootUpTime is accurate. If it’s not accurate, it effects monitoring, the correlation of log data, event triggers, etc.

The default Manual trigger of the Windows Time service is based on domain membership, which seems to cause issues as the image boots and changes name to the correct target name. Without having a deep enough understanding on the inner workings of these technologies, I can only assume that the default trigger of the Windows Time service is not compatible with the way the imaging mechanisms work on boot up to change the computer name and join to an Active Directory computer object. There may be a point during startup where Windows detects that it’s not domain joined and therefore stops the Windows Time service, which seems to throw the time out.

Read more

XDPing PowerShell Function

I wanted to write valid PowerShell function to do an XDPing the same way Citrix do with their Health Assistant tool. I was struggling a little to get the PowerShell code working as expected, so in the end I used the JetBrains dotPeek .NET decompiler to decompile the VDAAssistant.Backend.dll, which is a component of the Citrix Health Assistant Tool. This allowed me to reverse engineer and understand how Citrix does it in C# .NET, which is then easy for me to convert to PowerShell. Yeah…okay, so I cheated at little 😉 I also released a C# (csharp) function I wrote back in 2020.

I used this PowerShell function in two scripts:

To test if the Broker service is reachable, listening and processing requests on its configured port, you can issue blank HTTP POST requests at the Broker’s Registrar service, which is located at /Citrix/CdsController/IRegistrar. If the first line displayed/returned is “HTTP/1.1 100 Continue“, then the Broker service responded and is deemed to be healthy.

Read more

Controlling the Starting of the Citrix Desktop Service (BrokerAgent)

UPDATED 17th November 2025

  • Improved the check for the Personality.ini and MCSPersonality.ini files based on the history of VDA changes.
  • Replaced the Get-LastBootTime function with the Get-UpTime function. This starts to phase out the reliance on the Get-WmiObject cmdlet, with preference to use the Get-CimInstance cmdlet.
  • Added a group policy update (gpupdate) to be invoked before it reads the VDAHelper registry values. I’ve
    found this hit and miss with MCS images. So a gpupdate helps to ensures that the registry values are in
    place.
  • Added a check to see if it is a Citrix MCS Master Image. The script will check the following value:
    Key: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Configuration
    Type: DWORD
    Value: MasterImage
    Data: 1
    This is important so that it starts the Broker service immediately so that it does not cause any issues
    with the image preparation process.

UPDATED 21st July 2025

  • Added extra error checking and further improved the coding
  • When we set the Winlogon DefaultDomainName value we also need to set AutoAdminLogon value to 0 and clear the DefaultUserName value.
  • If the Winlogon AutoAdminLogon value is 0 (disabled), and the TriggerOnTaskEndEvent is set to 1 (enabled), we change the TriggerOnTaskEndEvent to 0 (disabled). This reduces unnecessary further delay waiting for an event that will never run.

UPDATED 14th July 2025

  • Replaced the Get-DeliveryControllers function with the Get-ListOfDDCs function. The name of the function may have been misleading given that it’s for both Delivery Controller or Cloud Connector addresses. It now allows for the C:\Personality.ini and C:\MCSPersonality.ini for MCS deployments.
  • Added the UsePersonalityini value to the VDAHelper registry values, which is used to call the updated Get-ListOfDDCs function.
  • Updated the XDPing function
  • Changed the flow of some of the code

UPDATED 31st January 2023

  • Added the DefaultDomainName value to the registry, which tells this script to set the Winlogon DefaultDomainName value in the registry once the autologon process has started. This allows us to use a local account for the Autologon process instead of a Domain service account, which won’t work if the Winlogon DefaultDomainName value has already been set to your preferred domain. This reduces the security footprint when using service accounts by allowing us to easily rotate passwords using a local account for the autologon process for each image build. Refer to my article Priming a Non-persistent Windows Image using an Autologon Process with an Auto Logoff Timer to understand how this works.
  • You can now use the policies registry key for the registry settings:
    • Policies Key: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Citrix\VDAHelper
    • Preferences Key: HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\VDAHelper
    • Values set under the Policies key have a higher priority.

UPDATED 30th April 2022

  • Improved the code so that the logon/logoff events are detected more efficiently across all Windows Operating Systems.

UPDATED 17th March 2020

  • Enhanced the checking for the ListofDDCs registry value by also checking the Policies key structure.

UPDATED 18th July 2019

  • The creation of the Scheduled Task needed for this script can be found in the Citrix Virtual Delivery Agent (VDA) Post Install Script. It’s important that the priority of the Scheduled Task is set to normal to prevent it from being queued.
  • Enhanced the Get-LogonLogoffEvent function for backward support of Windows 7/2008R2

UPDATED 16th May 2019

  • Added much more logging with timestamps to help debug issues and correlate events. You’ll see from the screen shot of the log file below that it’s now quite comprehensive.
  • Ensured that the format of the logging timestamp and LastBootUpTime were aligned so that its accuracy can be easily verified as I documented here.
  • Added an XDPing function I wrote to health check the Delivery Controllers.

This is a process I’ve been working on perfecting for a couple of years now. I’ve got it to a point where it works perfectly for my needs, and has been very reliable over the last few months, so I decided it was ready to release to the community.

The challenge has always been that as a Session Host boots up the Citrix Desktop Service (BrokerAgent) starts and registers with the Delivery Controllers before the boot process is complete. Therefore, a user can potentially launch an application/desktop during the tail end of the boot process. When this happens it may fail the session launch, which can leave the Session Host in an unhealthy state, such as a stuck prelaunch state, with the user potentially needing to involve the Service Desk to clear the issue. So managing the timing of the start of the Citrix Desktop Service (BrokerAgent) is extremely important to ensure that your Session Hosts have completed their startup process before registering with the Delivery Controllers. This can be easier said than done!

To add to this complexity, power managed Workstation OS pools can get into a reboot loop if you use an autologon process. I use an autologon process similar to what George Spiers documented in his article “Reduce Citrix logon times by up to 75%“. So if the Session Host has registered with the Delivery Controllers before the autologon process has logged off, the logoff process will trigger another reboot. This can become a real problem to manage.

Read more

Introducing the new AppDNA Platinum Edition and Goodbye and RIP to the Standalone Editions

The Excitement:

Last June Citrix included a cut down licensed version of AppDNA as part of the XenDesktop 7 Platinum license. As excited as everyone was at the time, this license was so restrictive that you could only analyse applications using the SBC module. Back then I wrote an article titled “AppDNA is now included with XenDesktop 7 Platinum, or is it just a tease?“, which pointed out the limitations of this release. Clearly Citrix took my feedback seriously, as now they have included a full unrestricted license with XenApp or XenDesktop 7.5 Platinum. It is totally unlimited across all modules! How cool is that?

In the announcement they say that “The inclusion of all the AppDNA capabilities in Platinum editions helps IT address a variety of migration issues, including how to virtualize applications ahead of Microsoft Windows XP and Windows Server 2003 end-of-life milestones.” It’s a funny marketing statement given that Windows XP will reach it’s end-of-life milestone 13 days after these new capabilities are released into the Platinum editions!

The Disappointment:

To make matters worse Citrix, in their infinite wisdom, have also decided to drop the standalone versions altogether. So as of 28th April you will no longer be able to purchase the Standard or Enterprise editions. This is so uncool! In fact the EOM (End Of Maintenance) for the version 7.1 and later standalone editions is 31st October 2015, and the EOL (End Of Life) is 31st October 2016. So there is no value in purchasing the product if its last sale date is a little more than a month away. 

Read more

AppDNA is now included with XenDesktop 7 Platinum, or is it just a tease?

I was excited by the recent announcement during the Citrix Synergy 2013 keynote that an AppDNA license will be included with the upcoming release of XenDesktop 7 Platinum edition. Yes! Now one of my favourite tools, so needed in this space, gets to shine alongside the flagship products. This sparked so much excitement and conversation during the week of Synergy and thereafter.

There are, however, a couple of gotchas, that if not understood up front, will lead to disappointment. So let me explain.

Read more

WAN Emulation for VDI and SBC Testing

WANem (Wide Area Network Emulation) is an awesome tool for emulating a WAN in your test/dev environment or even a demo lab. I use it in my demo lab to show customers how the technologies might behave in their environment.

WANem is a piece of software running on Knoppix, a well-known Linux distribution based on Debian. It comes in two forms:

  1. As an ISO that is launched through a LiveCD at computer startup.
  2. As a VMware Virtual Appliance that can be launched from a VMware platform.

You can get WANem from here: http://wanem.sourceforge.net/

Read more

User-Self Help Tools for an SBC and VDI Deployment

Whenever I implement a Citrix/Terminal Server farm, I always include certain applications and tools that I believe users will get some value from, which may in-turn assist IT Support by lowering the number of helpdesk calls. Who knows???

I have blogged about all these tools before…

Their Start Menu shortcuts can be seen in the screenshot below.

Read more