

So with the culprit at hand and more troubleshooting, we found that Interestingly, if a user disconnected and reconnected, this issue did not occur. The first trigger however is the money shot, As you can see below this user log in caused this event to trigger, which then triggered in a cascading effect in all user sessions: The Second trigger seems to be related to the event log which turned out to be not related as Microsoft supress this task from running twice it seems by assigning a zero value GUID to the task. Looking at the history tab, we can see that during a user login, both events are triggered as below. As you can see, the two interesting triggers are the “On an event” & “At Logon”. Below is a list of triggers configured for this task.

Under this task category, we can see 3 tasks.Īs above, its the UserTask that seems to be running, so lets have a look at this. Taking the above path as an indicator, I launched Windows Server Manager and browsed to Configuration > task scheduler > Task Scheduler Library > Microsoft > Windows > CertificateServicesClient:

$ts = New-Object -ComObject Schedule.ServiceĪnd the output of the above command gave us the following hint: As the CPU was maxing out during this process, it was quite easy to catch first time.īelow is the command I used to catch the running tasks during the CPU spike: The user login process in our case seemed to be triggering an event across all sessions that was consuming all the CPU, but which task runs on every login?Īs I ventured further down the rabbits hole on this one, I resorted to my good friend PowerShell to catch a user login and see which processes or “Scheduled Tasks” were running at this time. In Server 2008 and upwards scheduled tasks are no longer limited to times or schedules, scheduled tasks can now operate on triggers or events too. Intermittently throughout the day, the XenApp’s CPU would max out, and as the load increased on the XenApp servers the timeframe in which the CPU would max out would get longer and longer.įrom Initial troubleshooting we found that after 7 users logged into the XenApp server, the next user login would cause the server to hang.ĭuring this hang, using process explorer we found an instance of taskhost.exe for each logged in user running at this time:Īs most of you will already know, taskhost.exe is the process handler for scheduled tasks, and as most of you will also know scheduled tasks have changed in a big way since server 2003. Recently while configuring a XenApp 6.5 hosted desktop environment we experienced a weird CPU spike across all XenApp sessions on a server. This was such a weird, wonderful and perfect storm issue I felt I had to post it.
