Reduce Citrix Director Interactive Session Time to as little as 3 seconds

The Interactive Session metric recorded by Citrix Director has always confused those trying to investigate why logon times are so high.

In this post I’ll explain how you can cut Interactive Session time by more than 60% immediately. You can reduce the time to as little as 3 seconds. This allows Citrix Director logon time reporting to become much more accurate.

If you are running VDA 7.16+ then you don’t need to do anything to upmEvent.exe as described in this post, however I still recommend you read the post as it is interesting to understand how Director calculates logon times. If you are running versions earlier than 7.16 then this post will fully apply to you.

For more logon time reduction tips see https://jgspiers.com/citrix-director-reduce-logon-times/

Are you running VDA 7.16+? Changes to VDA 7.16+ – upmEvent.exe is now run as part of Winlogon:

Since this post was originally created in May 2017, Citrix have since in VDA 7.16 to 7.18 removed the upmEvent.exe run key and moved it to the Userinit string.

This change results in upmEvent.exe running much quicker than previous versions because Citrix have allowed Winlogon to run the .exe, moving upmEvent.exe away from the Run registry key. This is an out of the box enhancement with no further configuration required.

Note: In VDA 1808 and above, upmEvent is now processed by the Citrix Profile Management service.

What is Interactive Session Time?

From https://www.citrix.com/blogs/2016/08/19/interactive-session-of-logon-duration-in-citrix-director-explained/

It is the time taken to handoff keyboard and mouse control to the user after the profile of the user is loaded for a session.

Event ID 2 is initially logged on the VDA shortly after a desktop/application icon is clicked within Receiver client or Receiver for Web. This event triggers the Interactive Session timer which ends once Event 1000 is logged to indicate that the session is ready for use. Event ID 1000 is logged by the Citrix Profile Management service.

So whilst Director records logon times, it is important to understand that this is the time taken from clicking to launch a resource until the machine is actually usable even though the actual logon may have completed some time before that. This produces innacurate results in Director for true logon times.

The Interactive Session time is calculated once Event ID 1000 is logged on the VDA. The faster the UPM Event User Message runs the quicker Event 1000 is logged and the calculation is complete.

So ideally we want upmEvent.exe (or UpmUserMsg.exe for VDAs prior to v7.7) to run once we see that desktop wallpaper as that is when the logon is complete. By default on VDAs before 7.16, it instead runs some time after the profile has loaded. In VDA 7.16 and above, upmEvent.exe runs at user logon, even before the desktop wallpaper has loaded. This results in more accurate logon times out of the box.

For VDAs earlier than 7.16, what is faster than startup applications specified within the Run key? A log on Scheduled Task or specifying upmEvent.exe in the Userinit registry string..

On VDAs earlier than 7.16, open your gold image or Citrix App Layering Platform Layer (the Platform Layer should contain your VDA software). Launch RegEdit and navigate to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. Delete the Citrix UPM UserMsg string. Finalise the image.

Now using Group Policy, create a new GPO which applies to all users logging on to the VDA.

Within the GPO expand User Configuration -> Preferences -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7).

On the General tab specify a name. Keep the task running under %LogonDomain%\%LogonUser%. Set Configure for to Windows 7 or the highest available OS.

On the Triggers tab click New.

For Begin the task choose At log on and for Any user. Click OK.

On the Actions tab click New.

Under Action select Start a program. Under Program/script enter “C:\Program Files\Citrix\Virtual Desktop Agent\upmEvent.exe” and beside Add arguments (optional) enter wait. Click OK.

Click OK to finish creating the Scheduled Task. When users log on to a VDA the UPMEvent.exe program launches via Scheduled Task immediately when the desktop shell has loaded.

With UPMevent.exe being started now by the Scheduled Task the average logon time has dropped to 13 seconds. Notice the Interactive Session times are all at 3 seconds, more than 50 seconds lower than a default XenDesktop 7.13 installation I ran my testing on. These results are on a non-persistent VDA which is rebooted between each logon.

Director is logging much truer logon times and our future reports will be much more accurate.

Note: In VDA versions before 7.7, upmEvent.exe was called upmUserMsg.exe.

Alternatively, instead of using a Scheduled Task for VDA 7.13 and below, you could instead move upmEvent.exe to the Userinit string. You can perform this change directly in an App Layer or gold image if using PVS/MCS. This is exactly what Citrix are doing in 7.14.1 and above VDA releases. This string is stored under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

Difference in logon times between VDA 7.13 and VDA 7.16 out-of-box installs:

I’ve done some testing on the difference between Director logon duration recordings from a VDA 7.13 machine which has upmEvent.exe specified under the Run registry key and VDA 7.16 which has upmEvent.exe specified under the Userinit string. These are simple tests, no profile management or such is used.

Testing logons with a VDA 7.13 machine:

Citrix Director recorded times:

  • Logon 1: 32.534sec
  • Logon 2: 31.447sec
  • Logon 3: 31.8sec

Stopwatch recorded times:

  • Logon 1: 18.7sec
  • Logon 2: 17.43sec
  • Logon 3: 17.63sec

Outcome: Director is reporting around 13-15 seconds longer logon times than what I am recording when timing resource launch to reaching the desktop wallpaper.

Testing logons with a VDA 7.16 machine:

Citrix Director recorded times:

  • Logon 1: 21.57sec
  • Logon 2: 20.466sec
  • Logon 3: 21.713sec

Stopwatch recorded times:

  • Logon 1: 25.47sec
  • Logon 2: 25.26sec
  • Logon 3: 26.22sec

Outcome: Director is reporting around 4-5 seconds shorter logon times than what I am recording when timing resource launch to reaching the desktop wallpaper.

As you can see, with upmEvent.exe running as part of Winlogon, Director is recording a logon time shorter than what the stopwatch is. The stopwatch time is the time taken to click on the desktop resource in Receiver for Web to first seeing the desktop wallpaper. This means that Director on average is recording a logon time 4-5 seconds before the user actually sees a desktop wallpaper.


57 Comments

  • Sommerers

    May 3, 2017

    Do you know if a GPO Scheduled task is faster than a WEM task? I assume it would be but figured I’d inquire.

    Reply
    • George Spiers

      May 3, 2017

      I’ll bet that a Scheduled Task is faster than WEM – give it a shot?

      Reply
      • Sommerers

        May 3, 2017

        I’m toying with this right now, but so far the results from WEM aren’t impressive. I still need to do an assignment order test to see if that makes any differences. I did also test with a GPO Scheduled Task but didn’t get as low of a result as you did, but I believe this is due to my configuration. If someone else is noticing the same you can go into the eventlog and under “Applications and Services\Microsoft\Windows\TaskScheduler\Operational” you can validate that the UPMEvent triggers in the first 3 seconds of logon. I did have a question about the GPO Schedule. By default the Priority is set to 7 for the task if we could somehow bump it to 4 would this improve the interactive Session more? I really don’t know what the metrics would looks like and if this would really help align the login time more. I was just looking up something and started wondering what would happen.

        Reply
        • George Spiers

          May 3, 2017

          The priority can be changed by editing the scheduled tasks XML file within SYSVOL. Setting a priority of 6 didn’t have a big effect on the logon times. Some times were lower and others higher.

          Also see https://jgspiers.com/citrix-director-reduce-logon-times/ for some more logon improvement tips. I used these to help get the times down to 3 seconds.

          Reply
  • Sommerers

    May 3, 2017

    I think there is a typo at “%LogonDomain%\LogonUser%” it looks like you are missing a “%”.

    Reply
    • George Spiers

      May 3, 2017

      Yes it is a typo, thanks. Corrected!

      Reply
  • pzario

    May 3, 2017

    when i set Scheduled task , interactive session increase to 2x time ?
    normal : 5 sec
    with ur option : 10-12 sec

    Reply
    • George Spiers

      May 3, 2017

      That is not normal. Do you have the Scheduled Task set to run at log on? To be honest, if you are already getting 5 second Interactive Session Time then you are OK.
      This will more help people whose current times are above the 20+ mark.

      Reply
  • James

    May 4, 2017

    awesome! bit of typo in the schedule task creation – need to specify the full path to the .exe 🙂

    “C:\Program Files\Citrix\Virtual Desktop Agent\upmEvent.exe”

    Reply
    • George Spiers

      May 4, 2017

      The Scheduled Task doesn’t require .exe to be filled in, atleast for me it didn’t. Did you have to specify it?

      Reply
      • James

        May 4, 2017

        I did in both the environments i put it into today – without the .exe i got a “not found” error in task scheduler – epic results though, this has been a nuisance for a long time so well played 🙂

        Reply
        • George Spiers

          May 4, 2017

          Thanks James.

          Reply
  • Kai Guettner

    May 4, 2017

    So does this actually reduce the login time, or just the representation of it in Director?

    Reply
  • ourgeisinger

    July 12, 2017

    Check the event log for the UPMID. Use the time as a starting point in Procmon to go back in time for the amount of time shown in Director for the interactive session.

    Reply
  • Dustin

    January 10, 2018

    Does this allow the user to get to work on the desktop quicker or is it just about making director show a lower interactive session? I have a customer getting 23 second interactive session time consistently on Non Persistent VDI with no UPM in play.

    Reply
    • George Spiers

      January 10, 2018

      Optimisations allow the user to get to work quicker. Creating a lean, well controlled image. The post is designed to straighten out the logon time reports that show in Director. For optimising an image and some tips on reducing logon times see http://www.jgspiers.com/citrix-director-reduce-logon-times

      Reply
  • Dimitris

    January 17, 2018

    I performed this change but now on director I get “the logon duration data for the current session is not available”

    Reply
    • George Spiers

      January 17, 2018

      That to me would indicate that upmEvent.exe did not run, and Event ID 1000 was not generated. Check the Scheduled Task to see why it is not running.

      Reply
  • Steve Elgan

    February 1, 2018

    In my environment it’s almost as if it just ignores the interactive session piece all together in the calculation. Without this change director shows about 43 seconds which is really close to my stop watch time. With this change, director shows the login anywhere from 12-16 seconds but my stop watch is still closer to 40. I think this is due to using mandatory profiles with RES layered on top. I have WEM installed for optimizations but none of the user settings. I almost want to test that out to see if it’s faster with WEM vs RES for the user personalization stuff.

    Reply
    • George Spiers

      February 1, 2018

      If Director is accurate enough then I’d go for that. Not sure how it is reporting 12-16 seconds though if you probably don’t even see the desktop wallpaper by then.

      Reply
  • Anonymous

    February 6, 2018

    I’m seeing interactive times as high as 1100 seconds for some users.

    Reply
  • Adam

    May 14, 2018

    I followed this guide using 7.13 and the interactive logon time hasn’t changed in the slightest.

    Reply
  • Pingback: Black screen at session logon with VDA newer than 7.15 CU1 - Adam Clark %

  • Pingback: Black screen at session logon with VDA newer than 7.15 CU1 – Xenit Technical

  • Richard Hughes-Chen

    July 13, 2018

    Is this required with 7.15 as seeing high interactive logon times anywhere between 20 seconds and 200.

    Reply
    • George Spiers

      July 13, 2018

      7.14.1 should be slightly better at recording interactive session time so long as upmEvent.exe resides in the userinit string under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon. Some of these tips help to reduce that time further.

      Reply
      • Richard Hughes-Chen

        July 14, 2018

        I’m confused at this as it seems the discussion is about Director mis-reporting logon times. Surely if the actual logon time is less then what Director reports due to the incorrect recording of the interactive logon it should be removed from Director all together?

        We are running 7.15.1 and see the times vary dramatically.

        Reply
  • Mayur

    August 14, 2018

    Hi George,
    I have also been running some comparisons on out of the box 7.15.2, and what I am seeing is the interactive session seems to be consuming on average about 6 secs with no GPO settings applied.

    I have checked the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon key and I have the C:\Windows\system32\userinit.exe registered.

    Am I right to understand there is no longer any need to modify any settings in order to get the Director to register logon times more accurately then what it is indicating now?

    Cheers,
    Mayur

    Reply
    • George Spiers

      August 14, 2018

      That sounds like a normal time to me, so I wouldn’t imagine there is much room for improvement. Normally I like to make sure that upmEvent.exe is now part of the userinit string.

      Reply
    • Andrew Webber

      August 22, 2018

      I was seeing long interactive session times on 2 new 7.15 CU2 XenApp builds and it seems 7.15 also runs the UPMEvent via the RUN key rather than Winlogon. I haven’t checked a desktop VDA yet, so could be related to just the server VDA.

      The scheduled task workaround works well with 7.15.

      Reply
  • Mayur

    August 14, 2018

    Hi George!
    Thanks for putting my mind to rest 🙂 As always, greatly appreciate your help.

    Cheers,
    Mayur

    Reply
  • Anonymous

    August 23, 2018

    Hi George,

    I had this Schedueled Task when I was on 7.13 and totally forget to remove it, I faced an issue with 7.15 CU and it turned out it was this Task, it was making user stuck at logoff for some reason and leaving winlogon waiting for CSEengine, Thought to post this here, if someone missed removing it.

    Reply
  • Mina Nashed

    August 23, 2018

    Hi George,

    I had this Schedueled Task when I was on 7.13 and totally forget to remove it, I faced an issue with 7.15 CU and it turned out it was this Task, it was making user stuck at logoff for some reason and leaving winlogon waiting for CSEengine, Thought to post this here, if someone missed removing it.

    Reply
  • Timon

    October 17, 2018

    Hi George,

    Just to echo some of the previous comments this is still a requirement for 7.15 VDAs. We had deleted the registry key from our 7.15 image and disabled the scheduled task as we thought it was not longer required. This lead to issues with Director not displaying the logon duration for some users.

    I have had the following comment from Citrix support:

    “EventId 1000 is needed for seeing the logon duration in the director.

    No event 1000 = logon duration is NULL in the DB.

    If we add the UPM UserMsg key it will work and give us the event id 100 and logon duration in director. It does not matter where the upmEvent is added. As long as this is there, the logon duration will be reported.

    For a default location, on VDA 7.15 we have it under the run key. For the VDA version 7.16 till 7.18 we have it under userinit.”

    Reply
    • George Spiers

      October 18, 2018

      That is true. upmEvent.exe needs to run to generate Event ID 1000. I prefer to configure the “Userinit” registry string to run upmEvent.exe.

      Reply
  • Darren Price

    January 4, 2019

    Hi George, do you know if this issue is fixed in 7.15 LTSR CU3?

    Reply
    • George Spiers

      January 4, 2019

      CU3 from my findings still has upmevent listed under the Run key.

      Reply
  • Darren Price

    January 4, 2019

    Thanks, is there any reason why you are suggesting doing scheduled task via GPO instead of including locally on the gold image?

    Reply
    • George Spiers

      January 5, 2019

      You can do it either way. Although rather than using the Scheduled Task method, I’d suggest just moving upmevent.exe to the Userinit string as described in the article.

      Reply
  • mw

    January 21, 2019

    I followed this guide, using 7.15 CU3 – now i see no results in director – “average logon duration”. GPO is working and the scheduled task runs successfully. do you have any idea?

    Reply
    • George Spiers

      January 28, 2019

      Instead of using a Scheduled Task, have you tried moving upmEvent.exe to the ‘Userinit’ registry string?

      Reply
  • MJ

    February 1, 2019

    i’ve setup StartupDelayInMSec reg key in WEM and my Interactive Session went down from 14 to 4 seconds in Director running XenApp 7.15 CU3

    Reply
  • Jan Mulder

    February 6, 2019

    Hi George, after moving the UPMEvent.exe to the userinit string, director is showing a lower interactive logon time but is not showing the user in “Logon Duration by User Session”.

    I have also tried it with a scheduled task, but see the same results. Wheb putting it back with a GPO to the Run key , director is showing Logon Duration by User Session.

    Reply
    • George Spiers

      February 7, 2019

      What version of Virtual Apps/Desktops are you running?

      Reply
  • David

    April 26, 2019

    In the HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit value, is that 3 commas or 3 periods?
    It would be nice to be able to copy and paste. Thanks for the helpful guide!

    Reply
    • George Spiers

      April 26, 2019

      Hello, that is three commas however you only need one separating two different values.

      Reply
      • David

        April 29, 2019

        Thank you. Please note that I had a client having issues launching Microsoft Office products after making this change to the Userinit value directly in the VDA Master Image, and had to revert. I will now attempt the Scheduled Task option.

        Reply
        • George Spiers

          May 3, 2019

          Odd – I’ve not seen the same problem. Also note that later versions of the VDA fire upmEvent from a service.

          Reply
  • Sascha

    October 8, 2019

    Strange, in our VDI environment (VDA 1906) the times showed by the Director are 20-30sec less than the real logon times, which I checked with my stop watch.

    Reply
  • Anonymous

    October 15, 2019

    How can we get user authentication time metric ?

    Reply
  • Sohail Pendhari

    September 25, 2020

    hi thanks for this article – Is this tweak for just to see happy numbers on Director for Interactive Phase – Because when i measure via stop watch the logon time is same before and after applying this fix ,from ica click to desktop wallpaper logon phase but Interactive session is reduced drastically from 200 sec to 10 sec in my case .

    Is this a bug in Xendesktop or do we have any Bug ID or Known issue article from Citrix – I tried but didn’t find any citrix KB for fix mentioned in your article .

    Thanks

    Reply
  • Pingback: http citrix interactive session slow login com Account Portal Instructions Help Guide - trustne.com

  • md sabhath ali

    May 7, 2022

    Hi George Spiers,
    when user launch the pub application if he is first user on VDA he is facing the slow logon to 6 t0 10 minutes
    were as secound user it just take 45 secound

    please suggest me what to do

    Thanks

    Ali

    Reply
  • Graham Mason

    January 23, 2023

    Hey George,

    not sure if you are still maintaining this as its 6yrs old – but i thought i would confirm if this makes a difference in 2203 or not ?

    Reply
    • jcmoriaud

      February 28, 2023

      Hello,
      I’d appreciate also an update !
      Thanks in advance, cheers

      Reply
  • Asif

    September 11, 2023

    Hi, Does it still apply on Citrix DaaS with on-prem 1912 cu7 . we use published apps only with 2k12R2 hosting VDA servers.

    Reply

Leave a Reply