Skip to main content

OneDrive

PowerShell for administering OneDrive for Business. The reporting scripts use Microsoft Graph; the access script uses PnP.PowerShell (see Microsoft 365 — Overview & Connection).

Scripts​

Why OneDrive gets its own section​

OneDrive drives are SharePoint site collections, so the SharePoint scripts will technically enumerate them — and swamping a 40-site tenant report with 400 personal drives makes both reports useless. More importantly the questions are different: a SharePoint site has owners and a purpose, while a OneDrive has exactly one owner whose departure is the event that matters.

Tip — Run the storage report before an offboarding

It answers the two questions offboarding actually needs: how much is in the drive, and is anything shared out of it. Doing that before the account is disabled is far easier than afterwards.