Saturday, February 22, 2020

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.

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

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

No comments:

Post a Comment