List all OneDrive Sites V2 – HTML Report

This is the version two of my earlier script that I shared back in 2018.

https://techwizard.cloud/2018/09/24/list-all-onedrive-sites-html-report/

New requirement came from one of our team is if we can show:

  • Storage sage of onedrive for user
  • Storage Quota assigned
  • Percentage of storage used.

Script will collect all the onedrive urls and save it in HTML table under report folder.

Download the script from Powershell gallery or from technet script gallery.

https://www.powershellgallery.com/packages/ListAllOnedriveSItes

https://gallery.technet.microsoft.com/List-all-OneDrive-Sites-V2-6a8a7365

Install-Script -Name ListAllOnedriveSItes

Once installed, you will be able to find the script in below location , you can run from there or copy it to some other location.
C:\Program Files\WindowsPowerShell\Scripts

Copy the script to the location you want and when you run it, it will create logs and report folder.

I am using onedrive site template as “SPSPERS#9” but I have seen in some tenants it is “SPSPERS#10”

Update the variable as per your environment.

$onedrivetemplate = “SPSPERS#9”

Once you will run the script it will ask you for the office 365 organization name and credentials for Sharepoint online administrator as shown below.

It will authenticate, generate the report and will save in the report folder.

For calculating percentage below powershell formula is used in the select statement.

@{L=‘Percentage Used’;E={“{0:N2}” -f (($_.StorageUsageCurrent/$_.StorageQuota)*100)}}

Report will look as below:

Thanks for reading and downloading

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

PowerShell Cheat Book

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s