I know PowerShell will do this, but I don't have access. So just using javascript, is there a script that can do item count, date modified, library or list, URL, and times viewed for all lists and libraries in a site?

enter image description here


Yes, you can use JSOM (Retrieve only specified properties of lists) / Rest API (Retrieving lists and list properties with REST) to fetch the lists properties.


I figured it out. Just post this html and JS code in a cewp on the site:

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script>

    <input type="file" style="display:none" id="getFile"/>
    <div></div><div><input type="button" id="btnSubmit" value="Get All Lists" /></div>
 <div id="divResults"></div>
 <div id="divAllLists"></div>


$(function () {
$("#btnSubmit").on("click", function () {debugger;


 function getAllLists() {
 var fullUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists";
 url: fullUrl,
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
success: onQuerySucceeded,
error: onQueryFailed

function onQuerySucceeded(data) {debugger;
var listItemInfo = "";
$.each(data.d.results, function (key, value) {
    var type = "List";
    if(value.BaseTemplate === 101){
        type = "Library";
listItemInfo += 'Title: ' + value.Title +' Last Modified: '+new Date(value.LastItemModifiedDate)+' Item count: '+value.ItemCount+' URL :'+value.ParentWebUrl+' Type: '+type+'<br />';
function onQueryFailed() {

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.