book
Article ID: CTX225857
calendar_today
Updated On:
Description
- Logon Duration in MonitorData.Session Table in Monitoring Database shows "Null" value for all sessions and hence Director does not report Average logon Duration for Sessions.

- Restarting the Monitoring Service on Delivery Controllers does not fix the issue.
- We used the below scripts to ensure that OS WMI providers have the information about the user logons and we got the correct output:
Windows 7 and Windows 2008 R2:
https://gallery.technet.microsoft.com/scriptcenter/Find-user-logon- duration-667b8c48
Windows 10 and Windows 2012 R2:
https://gallery.technet.microsoft.com/scriptcenter/Analyze-Session-Logon-63e02691
- We ran the below Powershell cmdlet on few VDA's to check if Citrix Profile Manager is getting the information form the Citrix Profile Manager WMI provider or not and in this case we did get the results.
get-wmiobject -namespace root\citrix\profiles\metrics -class logontimings
We collected CDF Traces from VDA and DDC.
- We saw the below exception in CDF Logs from the VDA and we did not see any Logon Duration information being sent from VDA to DDC. There was nothing in CDF trace from Delivery Controller when we search for "LogonTimings"
BrokerAgent,_#dotNet#_,0,,9,CDF_NET_ERROR,"BrokerAgent:1:9:PluginManager.DeliverNotificationsToPlugins EXCEPTION in plugin: System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
at System.Diagnostics.Eventing.Reader.EventLogException.Throw(Int32 errorCode)
Environment
Caution! Using Registry Editor incorrectly can cause serious problems that might require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Be sure to back up the registry before you edit it.
Issue/Introduction
Logon Duration in Monitor DB's moniordata.sessions table is Null
Additional Information
- There are 3 EventLogs that UPM Vdaplugin reads to calculate the LogonDuration - Application, GroupPolicy Logs and , User Profile Service.
- It reads Group Policy event logs to get the events for Group Policy processing, User Profile Service log for profile load timings, and application log for 'Desktop Ready' event.
- It is the Desktop Ready event created in Application Event Logs that marks the end of the Session launch, and that is when the upmlogon payload is sent to Monitor service via Monitor vdaplugin via BrokerAgent.

- Ensure that events are being written to Application, Microsoft-Windows-GroupPolicy\Operational and Microsoft-Windows-User Profile\Operational event logs.
- Ensure that the log location is accessible and events are present for the time of user logon.
Reference:
https://blogs.technet.microsoft.com/askds/2011/08/29/the-security-log-haystack-event-forwarding-and-you/
https://support.microsoft.com/en-us/help/323076/how-to-set-event-log-security-locally-or-by-using-group-policy