AEM active user in aem 6.3 | Community
Skip to main content
Level 2
October 12, 2018
Solved

AEM active user in aem 6.3

  • October 12, 2018
  • 5 replies
  • 4080 views

Hi ,

I need to fetch list active aem users  for a certain period of time in aem author environment for some business requirement  .  Can you help ways to find out.

TIA.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by raj_mandalapu

Yes, there is no property to track user status under home/users

If it is a new requirement then I suggest you to use Sling Filters, this will fire for every request, so you can read the username and write it in either separate log file or use impersonation and write a new property to the logged in USER which is active=true

The first approach is very useful when you want to track other things not only usernames and the second approach is useful when you want to find only usernames by writing a simple query

Just a thought, First, check your requirements and if your requirements meet audit logs then you can check audit logs also, but you need to query audit logs

http://keysandstrokes.info/aem-sling-filters/

If you want to find out on the existing repository then

You can take out the logs and write simple java utility but I am not sure this will contains the username or not, but you need to check

Another approach which is complex one is writing a query which executes based on the date range predicate filter, get the list of the users and query against each node on lastModifiedBy property, but I am not sure this will meet your exact requirement or not. because if the author is not modified?

5 replies

smacdonald2008
Level 10
October 12, 2018

You can use Query Builder API to retrieve users as suggested in this community thread - can i retrieve the users list and along with their group names in query builder?

However - in AEM - the user node does not contain a property that tracks if a user has been active:

smacdonald2008
Level 10
October 12, 2018

See this thread for a similiar discussion on tracking user activity - How to log / monitor user activity in AEM6

kautuk_sahni
Community Manager
Community Manager
October 12, 2018

These 3 logs can help you with your use-case:

  • access.log : All access requests to AEM WCM and the repository are registered here.
  • audit.log. Moderation actions are registered here.
  • request.log Each access request is registered here together with the response.

Logs are located at <cq-installation-dir>/crx-quickstart/logs

Kautuk Sahni
raj_mandalapu
raj_mandalapuAccepted solution
Level 7
October 12, 2018

Yes, there is no property to track user status under home/users

If it is a new requirement then I suggest you to use Sling Filters, this will fire for every request, so you can read the username and write it in either separate log file or use impersonation and write a new property to the logged in USER which is active=true

The first approach is very useful when you want to track other things not only usernames and the second approach is useful when you want to find only usernames by writing a simple query

Just a thought, First, check your requirements and if your requirements meet audit logs then you can check audit logs also, but you need to query audit logs

http://keysandstrokes.info/aem-sling-filters/

If you want to find out on the existing repository then

You can take out the logs and write simple java utility but I am not sure this will contains the username or not, but you need to check

Another approach which is complex one is writing a query which executes based on the date range predicate filter, get the list of the users and query against each node on lastModifiedBy property, but I am not sure this will meet your exact requirement or not. because if the author is not modified?

smacdonald2008
Level 10
October 12, 2018

Excellent answer!