Citrix Director is great for showing you trends for logon performance, but you can’t yet “drill down” to determine which user specifically had the long log on duration. Luckily enough, the SQL database does have this information. The query below will show you all logons from the current day and sort them by LogOnDuration.
SELECT MonitorData.Session.StartDate, MonitorData.Session.LogOnDuration, MonitorData.Session.EndDate, MonitorData.Session.ExitCode,
MonitorData.Session.FailureDate, MonitorData.Session.ConnectionState, MonitorData.Session.ConnectionStateChangeDate, MonitorData.Machine.DnsName,
MonitorData.Machine.HostingServerName, MonitorData.Machine.HostedMachineName, MonitorData.[User].Upn
FROM MonitorData.Session INNER JOIN
MonitorData.[User] ON MonitorData.Session.UserId = MonitorData.[User].Id INNER JOIN
MonitorData.Machine ON MonitorData.Session.MachineId = MonitorData.Machine.Id
WHERE (CONVERT(varchar(10), MonitorData.Session.StartDate, 102) = CONVERT(varchar(10), GETDATE(), 102)) AND (MonitorData.Session.LogOnDuration > 0)
ORDER BY MonitorData.Session.LogOnDuration DESC
Alternatively, you can use this query for a more streamlined output with key data – Machine name, username, logon time (in seconds) with local time rather than UTC
SELECT CONVERT(datetime,switchoffset(convert(datetimeoffset,MonitorData.Session.StartDate),datename(tzoffset,sysdatetimeoffset()))) as StartDateLocalTime,cast((cast(MonitorData.Session.LogOnDuration as decimal(8,2))/1000.0) as decimal(8,2)) as LogOnDurationSeconds, MonitorData.Machine.DnsName,
MonitorData.Machine.HostingServerName, MonitorData.Machine.HostedMachineName, MonitorData.[User].Upn
FROM MonitorData.Session INNER JOIN
MonitorData.[User] ON MonitorData.Session.UserId = MonitorData.[User].Id INNER JOIN
MonitorData.Machine ON MonitorData.Session.MachineId = MonitorData.Machine.Id
WHERE (CONVERT(varchar(10), MonitorData.Session.StartDate, 102) = CONVERT(varchar(10), GETDATE(), 102)) AND (MonitorData.Session.LogOnDuration > 0) and EndDate IS NULL
order by StartDateLocalTime desc
Hi,
do you know if in the MonitorData tables of the db are logged the virtual applications launched by the users?
The only information I found is the hostname of the machine on which they logon.
Thank you,
F
Are you using a 7.6 DC / VDA? I believe that is only tracked on 7.6, but I haven’t verified that personally.
Pingback: It’s Not About a Successful “Citrix” or “VDI” Deployment | AtumVirt
I found it very useful to go through the stored procedures that director uses to retrieve data. I cant remember which schema it is, its either the chkstate or chkconfig, which ever one has over 400 stored procs. I figured out what queries behind most of the powershell cmdlets that way.
Hi
this works great, thx
How can i get the informations from the last 7 days.
Thank you
untouchable