Monitoring end-user experience is one of the most critical tasks for admins of Citrix Virtual Apps and Desktop 7. The logon duration metrics in Citrix Director are pivotal to ensuring the end-user experience is effortless and increasing productivity and thus, the delivering a way to work better. Citrix Director provides overall logon duration and a comprehensive breakdown of this duration into eight different phases. One of the most discussed phases and, many a time the largest, of these is Interactive Session.

Although the information about Interactive Session is covered in great detail in this blog post, for the sake of completeness, let’s begin with what happens during this phase. The following table summarizes the Interactive Session and its various subphases: 

Interactive Session Interactive Session is calculated as the time taken to hand off keyboard and mouse control to users after the user profile is loaded.
Pre-Userinit This is the segment of Interactive Session, which overlaps with Group Policy Objects and logon scripts (configured through GPO).

Tip: Consider optimizing the Group Policy Objects and logon scripts configured through GPO if this duration is high.

Userinit When a user logs on to a Windows machine, Winlogon runs userinit.exe which runs logon scripts, re-establishes network connections, and then starts Explorer.exe, the Windows user interface.

Tip: This duration could be higher if there is a network issue, the machine is not able to reach domain controller or a large number of logon scripts (corrupt) are configured through active directory user object.

Shell In the previous phase, Userinit starts the initialization of the Windows user interface. The Shell sub-phase captures the duration between the initialization of the user interface to the time user receives keyboard and mouse control.

Tip: This duration could be higher if the VDA is heavily loaded with numerous applications running or if desktop has too many icons, etc.

Starting with Citrix Virtual Apps and Desktop 7 1808 and latest Virtual Apps and Desktop service, Citrix Director displays a granular duration breakdown of Interactive Session into the subphrases mentioned above. This feature requires enabling Audit Process Tracking in Windows Security Logs (on VDAs) to view these durations. A group policy can be used to enable the required logs on a group of machines in Active Directory. For detailed steps, please refer to the product documentation. You can also use the following command on an individual VDA to enable Process Tracking on a single machine:

 “auditpol /set /category:”Detailed Tracking”

The additional volume caused by these logs is small and does not impact VDA performance in in-house validation. If Audit Process Tracking is not enabled, the combined duration of userinit and shell are displayed.

Enough said! Let’s take a look at the feature in action and how this can actually help in reducing Interactive Session duration by optimizing the individual subphases.

Sample scenarios

Userinit sub-phase optimization

Consider a scenario where several Logon Scripts are configured through Active Directory user object (not through GPO). These scripts could be used for drive mapping and un-mapping, printer creation, logging, etc. As mentioned earlier, the logon scripts configured through the AD user object are a part of Userinit subphase. Here, we have configured a script, which performs a shared drive mapping along with a 10-second delay to illustrate its impact on the Userinit and overall Interactive Session. When the user logs on, the Userinit and Interactive Session durations are as shown below:

As seen above, the Userinit duration is around 12 seconds and total Interactive Session duration is ~14 seconds. However, once the script is optimized to perform only drive mapping or if the script is removed, the Userinit reduces to 0.97 seconds and Interactive Session duration comes down to 3 seconds. Of course, this correction helps to bring down the total logon duration also by the same margin.

Shell sub-phase optimization

Let us consider a scenario of Shell subphase optimization. When a new session is launched on a VDA with already 8-9 sessions launched on it, the Shell duration is 1.38 seconds. However, if 5-6 sessions are logged out and a new session is launched on the VDA for the same user, the Shell duration is 0.14 seconds. The difference would be more crucial when the load on VDA is much higher and a large number of sessions are launched. Thus, the Shell duration can be optimized by ensuring proper VDA health in terms of the load.

In addition to scenarios mentioned above, Pre-Userinit can be optimized by reviewing Group Policy Objects and Logon Scripts configured through GPO for any anomalies. Also, from Director 1808 onwards, Group Policy Client Side Extension Processing along with error status ( if any ) are displayed. Check out the documentation on this feature to optimize GPO processing time and delve into detailed analysis. Both these features require latest Citrix Virtual Delivery Agent 7 1808 to retrieve and display the data.

For more information about logon duration and diagnosing user logon issues, see Citrix documentation or drop a comment!