Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Easy way to check lastlogin date for all users

ejeong
Valued Contributor
Valued Contributor

Could anyone explain me a way to export last login date for all users? by looking audit table, its taking too much time to query for all users..

 

6 REPLIES 6

dgandhi
All-Star
All-Star

Hi @ejeong 

Below queries should give you desired output. Check userlogins table.

dgandhi_0-1684286986694.png

Thanks

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

ejeong
Valued Contributor
Valued Contributor

I couldnt use this query it's taking very long time in our envrionment. 

don't you face any issue when querying all users with this query?

I didn't execute this in Prod so don't know about timing. But yes you can limit the output by adding some condition in the where clause.

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

rushikeshvartak
All-Star
All-Star

select u.username,ul.logintime,ul.logoutdate from users u left join userlogins ul on u.userkey=ul.userkey group by ul.userkey order by ul.logintime desc


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@rushikeshvartak 

I tried to create report with query provided 

but its taking long time as mentioned.

 

ejeong_0-1684294461382.png

 

Last 30 days 

select u.username,ul.logintime,ul.logoutdate from users u left join userlogins ul on u.userkey=ul.userkey
and ul.logintime BETWEEN CURDATE() - INTERVAL 30 DAY AND CURDATE()

group by ul.userkey order by ul.logintime desc


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.