List of Inactive users in AEM | Community
Skip to main content
akhilraj
Level 5
October 30, 2022
Solved

List of Inactive users in AEM

  • October 30, 2022
  • 2 replies
  • 2250 views

Hi Dears,

 

Is there a way we can fetch list/details of users who did not logged into AEM from past 6 months?

Kindly provide info if any..

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 BrijeshYadav

You can try with below 


p.hits=selective
p.limit=-1
path=/home/users
type=rep:Token
relativedaterange.property=rep:token.exp
relativedaterange.upperBound=-180d
p.limit=-1

But it will give you duplicate entries in result because a user can have multiple tokens stored so to avoid duplicate entries you can run the token cleanup task (com.day.crx.security.token.impl.TokenCleanupTask) 

2 replies

Manu_Mathew_
Community Advisor
Community Advisor
October 30, 2022
Level 3
October 30, 2022

Hi @akhilraj ,

 

Please follow this post it might be helpful in your case.

 

https://blogs.perficient.com/2017/02/23/managing-ghost-users-repository-growth-in-aem/

 

Thanks,

Mahesh 

BrijeshYadav
Level 5
October 31, 2022

One way to find the list of inactive users past xx days is via Query Builder.

p.hits=selective
p.limit=-1
path=/home/users
type=rep:User
relativedaterange.property=lastLogin
relativedaterange.upperBound=-180d
p.limit=-1

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=p.hits%3Dselective%0D%0Ap.limit%3D-1%0D%0Apath%3D%2Fhome%2Fusers%0D%0Atype%3Drep%3AUser%0D%0Arelativedaterange.property%3DlastLogin%0D%0Arelativedaterange.upperBound%3D-1d%0D%0Ap.limit%3D-1


 

 

akhilraj
akhilrajAuthor
Level 5
October 31, 2022

Hi @brijeshyadav : getting 0 result for this query execution

 

BrijeshYadav
BrijeshYadavAccepted solution
Level 5
November 1, 2022

You can try with below 


p.hits=selective
p.limit=-1
path=/home/users
type=rep:Token
relativedaterange.property=rep:token.exp
relativedaterange.upperBound=-180d
p.limit=-1

But it will give you duplicate entries in result because a user can have multiple tokens stored so to avoid duplicate entries you can run the token cleanup task (com.day.crx.security.token.impl.TokenCleanupTask)