User logs

  • 23 February 2020
  • 1 reply
  • 70 views

Badge +6

Hi.

 

I have requirement to capture user logs when they logged in to the system. created table with user columns. instead of creating rule in each smart form, is there any other way that I can capture on process/application specific so that to avoid creating rules in each form and view cause as I have too many forms and views.

 

Regards,

 

 


1 reply

Badge +7
Hi Thriveni, you can check K2 Management site -> Licenses for a list of all users that have logged into K2, and their last accessed date+time.

You can access this data by executing this SQL script and maybe building a Stored Procedure around it and generate a SmartObject from that:

DECLARE @ActiveOnly BIT
SET @ActiveOnly = 1

SELECT scc.[CredentialID]
,scc.[PrimaryCredential]
,scc.[IsPrimary]
,scc.[SecurityLabelID]
,COALESCE(id.[DisplayName], sl.[SecurityLabelName] + N':' + scc.[UserName]) AS [UserName]
,scc.[ExtraData]
,scc.[AllowCaching]
,scc.[PasswordCached]
,scc.[CreationDate]
,scc.[CustomUserID]
,scc.[IsActiveUser]
,scc.[LastAccessDateUtc]
,sl.[SecurityLabelName]
FROM [HostServer].[SecurityCredentialCache] AS scc
INNER JOIN [HostServer].[SecurityLabel] AS sl ON sl.[SecurityLabelID] = scc.[SecurityLabelID]
LEFT JOIN [Identity].[Identity] AS id ON id.[fqn] = sl.[SecurityLabelName] + N':' + scc.[UserName]
WHERE [IsPrimary] = 1 AND (@ActiveOnly = 0 OR [IsActiveUser] = 1)

ORDER BY [CredentialID] ASC;

Reply