How to export information about a user?

  Written by The Jahia Team
 
Developers
  users
   Estimated reading time:
7.1.2.1

Is there a way to export information of users in Jahia?

Answer

Sample JCR script:

javax.jcr.NodeIterator nodeIterator = session.getWorkspace().getQueryManager().createQuery("SELECT * FROM [jnt:user]", Query.JCR_SQL2).execute().getNodes();

while(nodeIterator.hasNext()) {
    JCRNodeWrapper node = (JCRNodeWrapper) nodeIterator.next();
    log.info(node.getPropertyAsString("j:firstName") + "," + node.getPropertyAsString("j:lastName") + "," + node.getPropertyAsString("j:email"));
}