Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

AEM active user in aem 6.3

gavyas
Level 2
Level 2

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.

1 Accepted Solution
raj_mandalapu
Correct answer by
Community Advisor
Community Advisor

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?

View solution in original post

5 Replies
smacdonald2008
Level 10
Level 10

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:

UserNode.png

smacdonald2008
Level 10
Level 10

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

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

raj_mandalapu
Correct answer by
Community Advisor
Community Advisor

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?

View solution in original post