AnsweredAssumed Answered

Retrieve List of users associated with a site

Question asked by anujsharma on Dec 8, 2017

I want to retrieve list of users with their associates sites



Can someone help me with a SQL query to get the data .


I know directly doing this with database is not good instead i should use webscripts.


I have tried the below webscript but it gives only 1000 results in html format


hello.get.html.ftl file

<table border><tr>    <th>Username</th>    <th>Groups</th>    <th>Sites</th></tr><#list test as child><tr>    <td>${child['username']}</td>    <td>${child['groups']}</td>    <td>${child['sites']}</td></tr></#list></table>


<webscript>  <shortname>Hello</shortname>  <description>Polite greeting</description>  <url>/test/hello</url>  <authentication>user</authentication></webscript>


var gens = search.luceneSearch("TYPE:\"{}person\"");var a = [];for (var i=0; i<gens.length;i++) { var username = gens[i].properties["cm:userName"];  var b = []; var groups = people.getContainerGroups(gens[i]); for(var j=0; j<groups.length; j++) {  b.push(groups[j].properties['authorityDisplayName']); }  var sites = siteService.listUserSites(username); var g=[] for(var j=0; j<sites.length; j++) {        g.push(sites[j]['shortName']); }  //a.push('\n\n\n'+username+'\groups--> '+ b.join(', ') + '\nsites--> '+g.join(', ')); a.push({    'username' : username,    'groups' : b.join(', '),    'sites' : g.join(', ') })} model.test = a;




Then i did some search and found that i need to change some property 
system.acl.maxPermissionChecks in file 

for increasing the result set size

but the problem is : in html view i am still getting 1000 results only

can someone help me to convert this html to csv format output
or a sql query to get the output fast and efficient