Script Overview

This enhanced script is based on the Analyze Logon Duration PowerShell script first published on the Citrix blog.  

The major addition to the original script is the "HDX Connection" logon phase, which covers the pre-Windows logon time and includes the HDX connection initialization time. In addition, the Logon Time now reflects the actual connection request time as seen by the XenDesktop Broker and the Session Init phase which cover the session creation process. The new phases are relevant only for the HDX XenDesktop 7.x connections.

With the above mentioned additions, the updated script now covers the entire logon process, from the moment the user clicks on the published resource until the Desktop is available.

The new module works by querying the XenDesktop Monitor service via 0Data API. The Windows session ID is translated to a XenDesktop SesionKey which is used in the 0Data API query.

Script Prerequisites

The following are the script prerequisites:

  • Windows PowerShell 3.0 and above
  • Local administrator privileges (required for querying the local event logs)
  • Read-only administrator role in the relevant XenDesktop site (even if Full admin rights are present, it is recommended to add Read-only rights as well)
  • Enable the auditing of process tracking via GPO or local security policy (secpol.msc) on all target XenDesktop VDA's
  • In order to support "older" user sessions it is recommended to increase the Security log size to 50MB or 100MB
  • Supply Target user session ID as a script parameter
  • Updated Citrix Receiver (on the physical endpoint that initiated the target HDX session)

It's worth mentioning it might take a few seconds for XenDesktop to populate the HDX connection times in the Monitor service database.

Script Output Example


Logon Phases

The following table summarize the logon phases the script covers and the Windows events used for calculating the start and end time for each phase:



Get The Script Now


References

  1. https://www.citrix.com/blogs/2013/09/20/director-logon-duration-explained/ 
  2. https://technet.microsoft.com/en-us/magazine/2007.03.vistakernel.aspx 
  3. https://msdn.microsoft.com/en-us/library/aa378775(VS.85).aspx 
  4. https://msdn.microsoft.com/en-us/library/windows/desktop/aa376106(v=vs.85).aspx 
  5. http://support.citrix.com/proddocs/topic/user-profile-manager-5-x/upm-how-it-works-den.html 
  6. https://msdn.microsoft.com/en-us/library/windows/desktop/bb776892(v=vs.85).aspx 
  7. http://blogs.technet.com/b/grouppolicy/archive/2013/05/23/group-policy-and-logon-impact.aspx 
  8. https://msdn.microsoft.com/en-us/library/ms811586.aspx 
  9. https://technet.microsoft.com/en-us/library/cc939862.aspx 
  10. https://support.microsoft.com/en-us/kb/195461 
  11. https://en.wikipedia.org/wiki/Active_Setup