Using Azure Automation to Generate SharePoint Online Site Collection Storage Reports

Tags: Automation, Azure, PowerShell, Reporting, SharePoint, SharePoint Online

We’ll keep this one short and sweet.  Jeff Jones (@spjeff) wrote a nice PowerShell script to generate an HTML-based report detailing SharePoint Online site collection storage quotas and usage.  You can view his original script and his post on it here:  http://www.spjeff.com/2015/05/18/office-365-monitor-site-collection-storage-ps1-daily-email/.

This is great for on-prem scenarios, but I’ve been doing a lot in SharePoint Online and wanted to see if I could adapt it to something that would work there.  I was able to do it using Azure Automation and PowerShell Runbooks there.  Here’s a short video I created that walks you through the solution:  https://onedrive.live.com/?cid=48105308A1A5ACCD&id=48105308a1a5accd%21255763&v=3.

Some pre-requisites:

  1. Need an Office 365 email account (I’m using my developer account)

  2. Need SPO admin access in an O365 tenant (global admin or SPO limited admin will work)

  3. SendMailUsingOffice365.ps1 needs to be published in order to test Get-SPOStorageInfo.ps1

While this is a sample of what’s possible, the real thing would be automated to run every day without human intervention.  I see this being extremely useful in all kinds of scenarios.  Getting this put together for the first time took me a few hours, but I definitely recommend spending some time with automation in Azure to check out the possibilities.