How can I find out which users have not logged into to Confluence for, say, 2 months?
Asked by Gus Hagelberg:

We would like to weed out users who aren't using the system regularly.

Global Activity seems to only show which users use the system the most.


Answers:
author: JP _AC Bielefeld Leader_
body: Hi Gus,

you could use a user macro like this one we use:

## [@Param](/t5/user/viewprofilepage/user-id/1345631) group:title=Group\|type=string\|required=true\|desc=Usergroup\|default=confluence-users

#set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))  
#set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))  
#set($containerManager = $getInstanceMethod.invoke(null,null))  
#set($containerContext = $containerManager.containerContext)  
#set($loginManager = $containerContext.getComponent('loginManager'))

#set($now=$content.currentDate.time)  
#set($group = $userAccessor.getGroup($paramgroup))  
#if($group)  
#set($usernames = $userAccessor.getMemberNames($group))  
#end  
#set($totalactiveusers = 0)  
\<table class="confluenceTable" width="660px"\>  
\<tr\>  
\<th class="confluenceTh"\>Name\</th\>  
\<th class="confluenceTh"\>Last login\</th\>  
\<th class="confluenceTh" style="text-align:center;"\>Days/Status\</th\>  
\</tr\>  
#foreach($username in $usernames)  
#set($t3="9999")  
#set($user = $userAccessor.getUser($username))  
\<tr\>  
\<td class="confluenceTd"\>#usernameLink($user.name)\</td\>  
\<td class="confluenceTd" style="text-align:center;"\>$action.dateFormatter.formatGivenString('yyyy-MM-dd HH:mm',$loginManager.getLoginInfo($user).lastSuccessfulLoginDate)\</td\>  
#if($loginManager.getLoginInfo($user).lastSuccessfulLoginDate)  
#set($t3= $now - $loginManager.getLoginInfo($user).lastSuccessfulLoginDate.time)  
#set($t3= $t3/1000/24/60/60)  
#end  
\<td class="confluenceTd" style="text-align:center;"\>  
#if($userAccessor.isDeactivated($user))  
\<ac:macro ac:name="status"\>  
\<ac:parameter ac:name="colour"\>Red\</ac:parameter\>  
\<ac:parameter ac:name="title"\>Disabled\</ac:parameter\>  
\</ac:macro\>  
#else  
#set($totalactiveusers = $totalactiveusers + 1)  
#if($t3 \< 7)  
\<ac:macro ac:name="status"\>  
\<ac:parameter ac:name="colour"\>Green\</ac:parameter\>  
\<ac:parameter ac:name="title"\>$t3\</ac:parameter\>  
\</ac:macro\>  
#elseif($t3 \< 31)  
\<ac:macro ac:name="status"\>  
\<ac:parameter ac:name="colour"\>Blue\</ac:parameter\>  
\<ac:parameter ac:name="title"\>$t3\</ac:parameter\>  
\</ac:macro\>  
#elseif($t3 \< 180)  
\<ac:macro ac:name="status"\>  
\<ac:parameter ac:name="colour"\>Yellow\</ac:parameter\>  
\<ac:parameter ac:name="title"\>$t3\</ac:parameter\>  
\</ac:macro\>  
#else  
\<ac:macro ac:name="status"\>  
\<ac:parameter ac:name="colour"\>Red\</ac:parameter\>  
\<ac:parameter ac:name="title"\>$t3\</ac:parameter\>  
\</ac:macro\>  
#end  
#end  
\</td\>  
\</tr\>  
#end  
\</table\>  
\<p\>Active users in group \<b\>$paramgroup\</b\>: $totalactiveusers\</p\>

Display a list of all Confluence users of a group (default: confluence-users) and the days since a last successful login.

Best

JP

comments: author: Gus Hagelberg
body: Thanks for the answer. I will try that out.


author: Thomas Schlegel
body: Hi [@Gus Hagelberg](/t5/user/viewprofilepage/user-id/1127343),

here is a knowledgebase article with the solution to your problem:

<https://confluence.atlassian.com/confkb/how-to-identify-inactive-users-in-confluence-214335880.html>


Tags: confluence-server

server