Scrapes data from SharePoint's Storage Management screen, capturing the data in a list
- Visit the storage management page at http://{TOP-LEVEL_SITE_URL}/_layouts/15/storman.aspx (this will get SharePoint to index your site's contents)
- Wait a few minutes, then refresh the page
- Run the code in stormanAudit.js
- Code will create a list matching the name at
stormanAudit.recordsListName
to captures its results - Run the code to scrape objects that meet or exceed the number of bytes specified at
stormanAudit.logObjectSizeLowerThreshold
, capturing each as a list item - Use a tool such as MS Access to analyze the results in the records list
- It checks if the records list (matching the name at
stormanAudit.recordsListName
) exists, and if not creates it + adds fields to capture the details of each site object - It scrapes the first page of site objects from the storage management page
- It captures each site object on the page in
stormanAudit.arrEntries
- For each object that meets the threshold at
stormanAudit.logObjectSizeLowerThreshold
, we check if it's a link that lets us drill down to its sub-objects- If an object has sub-objects, we append an element to
stormanAudit.arrSubentries
to queue the retrieval of those
- If an object has sub-objects, we append an element to
- If the last site object shown on the page meets the threshold at
stormanAudit.logObjectSizeLowerThreshold
, we append an element tostormanAudit.arrSubentries
to queue the retrieval of the next page of results
- It captures each site object on the page in
- It begins its semi-recursive* functionality by calling
stormanAudit.captureResultsThenGetSubEntries
which does the following:- Checks if
stormanAudit.arrPromises.length
is > 0, and if so...- Calls
stormanAudit.waitForAllData
to check the promises understormanAudit.arrPromises
to see if they are done, removing the completed promises as it goes until the array is empty - Calls
stormanAudit.captureFilteredResults
to create list items in the records list for each item scraped from the storage management page(s) into the arraystormanAudit.arrEntries
, capturing each element as a list item in the records list, appending the promise for each ansynchronous AJAX call to create the item tostormanAudit.arrCreateItemPromises
- Note that after looping through
stormanAudit.arrEntries
, thestormanAudit.captureFilteredResults
function callsstormanAudit.waitForAllItemsCreated
to wait for all of the promises understormanAudit.arrCreateItemPromises
to finish before proceeding - Calls
stormanAudit.loopPendingSubEntries
to loop through the queued sub-entry & "next" pages understormanAudit.arrSubentries
, removing array elements as it proceeds to request the storage management pages containing that data
- Calls
- Checks if
stormanAudit.arrPromises.length
is 0 -and-stormanAudit.arrEntries.length
is > 0, and if so...- Calls
stormanAudit.captureFilteredResults
to create list items in the records list for each item scraped from the storage management page(s) into the arraystormanAudit.arrEntries
, capturing each element as a list item in the records list, appending the promise for each ansynchronous AJAX call to create the item tostormanAudit.arrCreateItemPromises
- Note that after looping through
stormanAudit.arrEntries
, thestormanAudit.captureFilteredResults
function callsstormanAudit.waitForAllItemsCreated
to wait for all of the promises understormanAudit.arrCreateItemPromises
to finish before proceeding - Calls
stormanAudit.loopPendingSubEntries
to loop through the queued sub-entry & "next" pages understormanAudit.arrSubentries
, removing array elements as it proceeds to request the storage management pages containing that data
- Calls
- Checks if
stormanAudit.arrPromises.length
is 0 -and-stormanAudit.arrEntries.length
is 0, and if so...- Shows a SP.UI.Status message saying the process is done
- semi-recusive* by this, I'm referring to the back-and-forth 'conversation' that occurs between
stormanAudit.loopPendingSubEntries
andstormanAudit.captureResultsThenGetSubEntries
.- The
stormanAudit.loopPendingSubEntries
function callsstormanAudit.captureResultsThenGetSubEntries
when it is finished making the requests to retrieve the pages for the sub-objects and "next" pages that are queued understormanAudit.arrSubentries
- The
stormanAudit.captureResultsThenGetSubEntries
function callsstormanAudit.loopPendingSubEntries
whenever it is not done capturing all of the site objects that meet the threshold atstormanAudit.logObjectSizeLowerThreshold
- The
- Checks if