type: Guide collections: BCM, Software title: Full OneDrive Export via Microsoft Purview (Admin Workflow) description: A step-by-step guide to exporting an entire user's OneDrive content using Microsoft Purview through an admin workflow on Windows, including prerequisites, PowerShell commands, and export tips. tags: [bcm, commands, windows]
Full OneDrive Export via Microsoft Purview (Admin Workflow)
Goal: Export the entire contents of a user's OneDrive (e.g., francis@birminghamcitymission.co.uk)Environment: Windows machine with PowerShell + SharePoint Online Management Shell
✅ Prerequisites
- Global Admin or Compliance Admin role
- Added to Content Search or eDiscovery Manager role group in Purview Roles
- User has an active OneDrive and is licensed
- You’re on a Windows machine (locally, VM, or remote)
🛠 Install Required PowerShell Module
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force -AllowClobber
🔐 Connect to SharePoint Online Admin
Connect-SPOService -Url https://bcmission-admin.sharepoint.com
👑 Grant Yourself Site Collection Admin Rights on the User’s OneDrive
Set-SPOUser -Site https://bcmission-my.sharepoint.com/personal/francis_birminghamcitymission_co_uk `
-LoginName youradmin@birminghamcitymission.co.uk -IsSiteCollectionAdmin $true
⏱ Wait \~5–10 minutes for permissions to propagate.
📦 Create a New Content Search in Microsoft Purview
- Go to: Microsoft Purview
- eDiscovery > Content Search > New Search
- Name:
Full OneDrive Export - Francis - Location: SharePoint sites → Choose sites
- Enter manually:
https://bcmission-my.sharepoint.com/personal/francis_birminghamcitymission_co_uk - Leave Conditions empty
- Submit the search
⏳ Wait for Search to Complete
- Should show file count > 0
- If still 0 items, verify URL has no
/onedrive.aspx, and that admin rights were granted
📥 Export the Results
- Go to the Export tab of the search
- Click Export Results
- Choose:
- All items
- Include unindexed/encrypted
- Download and run the eDiscovery Export Tool
- Use the Export Key + Download URL
💡 Tips
- Store export on SSD or fast local drive
- If it fails, try re-running search or exporting in smaller batches
- Want to restore to another OneDrive? Use PowerShell or OneDrive Admin Center
📎 Reference Commands
# View all personal sites (OneDrives)
Get-SPOSite -IncludePersonalSite $true -Limit All | Where-Object { $_.Owner -like "*francis*" }
# Check if you’re site admin
Get-SPOUser -Site https://bcmission-my.sharepoint.com/personal/francis_birminghamcitymission_co_uk -LoginName youradmin@birminghamcitymission.co.uk
#bcm #work