Find recursive or circular group relations

Select circular relationships in the AD-groups directly from the database (migRaven 2.1)

Group-A is a member of group-B and group-B is again a member of group-A – which is quickly becoming a problem. One wonders why the user’s login is taking a long time. This can be a problem.

Whatever is not possible with the standard tools, can be easily found by using migRaven.

The first step is to identify the label for the database query. For this, one opens the browser with the following link:


Thereafter the value can be directly copied from the field “timestamp”.


Then transfer the value from the field timestamp directly into the following database query:


MATCH (n:i635536686308747589{type:”group”}) with collect(n) as n unwind n as gruppen match p=gruppen-[:rel_member*..]->gruppen

RETURN length(p) as Quantity, gruppen.name as Groups, extract(x in nodes(p) |x.name) as Recursive_Groups;

(If the error message: Invalid input ‘”’…. then the inverted commas in case of {type:”group”} are to be overwritten)

The query can be directly run in the database interface:



As a result of the query, one finds the size of the loop in the first column, the group in the second column that is in recursion and all groups in the third column that are in the loop:

Quantity Groups Recursive_Groups
2 8m_dl_firma01_rechte_modifyplus_mx 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_li, 8m_dl_firma01_rechte_modifyplus_mx
3 8m_dl_firma01_rechte_modifyplus_mx 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_li, 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_modifyplus_mx
1 8m_dl_firma01_rechte_modifyplus_mx 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_modifyplus_mx
3 8m_dl_firma01_rechte_modifyplus_mx 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_li, 8m_dl_firma01_rechte_modifyplus_mx
2 8m_dl_firma01_rechte_li 8m_dl_firma01_rechte_li, 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_li
3 8m_dl_firma01_rechte_li 8m_dl_firma01_rechte_li, 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_modifyplus_mx, 8m_dl_firma01_rechte_li