Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Citrix Director only gives Average information about logon. This query gives detailed and calculated information about the logontimes. */
- /****** Script for SelectTopNRows command from SSMS ******/
- SELECT LogonDuration = DATEDIFF(SECOND, [LogOnStartDate], [LogOnEndDate])
- ,[BrokeringDuration]
- ,[AuthenticationDuration]
- ,GpoDuration = DATEDIFF(SECOND, [GpoStartDate], [GpoEndDate])
- ,InteractiveDesktop = DATEDIFF(SECOND, [BrokeringDate],[InteractiveEndDate])
- ,FORMAT([BrokeringDate] , 'dd-MM-yyyy') AS EasyDate
- ,FORMAT([BrokeringDate] , 'HH') AS EasyHour
- ,[Name] AS VM
- ,[ClientName]
- ,[ClientAddress]
- ,[ClientVersion]
- ,[ConnectedViaHostName]
- ,[ConnectedViaIPAddress]
- ,[LaunchedViaHostName]
- ,[LaunchedViaIPAddress]
- ,[LogOnStartDate]
- ,[LogOnEndDate]
- ,[BrokeringDuration]
- ,[BrokeringDate]
- ,[DisconnectCode]
- ,[DisconnectDate]
- ,[ClientSessionValidateDate]
- ,[ServerSessionValidateDate]
- ,[EstablishmentDate]
- ,[AuthenticationDuration]
- ,[GpoStartDate]
- ,[GpoEndDate]
- ,[LogOnScriptsStartDate]
- ,[LogOnScriptsEndDate]
- ,[ProfileLoadStartDate]
- ,[ProfileLoadEndDate]
- ,[InteractiveStartDate]
- ,[InteractiveEndDate]
- FROM [MonitorData].[Connection]
- LEFT JOIN [MonitorData].[SESSION]
- ON ([MonitorData].[Connection].[SessionKey] = [MonitorData].[SESSION].[SessionKey] )
- LEFT JOIN [MonitorData].[Machine]
- ON ([MonitorData].[SESSION].[MachineId] = [MonitorData].[Machine].[Id])
- WHERE CONVERT(DATE,[LogOnStartDate]) = CONVERT(DATE,GETDATE())
- AND [IsReconnect] = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement