If you manage Microsoft 365, you may need a list of all OneDrive site URLs for your users. This is useful for audits, migration planning, or configuring third-party tools. Without a direct export button in the admin center, you must use PowerShell or the Microsoft 365 admin center reports to gather these URLs. This article explains two reliable methods to export OneDrive site URLs for all users in your tenant.
The first method uses the SharePoint Online Management Shell to retrieve URLs via PowerShell. The second method uses the Microsoft 365 admin center Reports page to export a CSV file. Both methods provide the same core data but suit different skill levels. By the end of this article, you will have a complete list of OneDrive URLs ready for export.
Key Takeaways: Export OneDrive Site URLs
- SharePoint Online Management Shell (PowerShell): Use the Get-SPOSite cmdlet with the -IncludePersonalSite parameter to retrieve all OneDrive site URLs and export them to CSV.
- Microsoft 365 admin center > Reports > Usage > OneDrive: Use the Files tab to download a CSV containing user names and their OneDrive site URLs.
- PowerShell script with filter: Add a filter to exclude deleted or non-provisioned OneDrive sites, ensuring you export only active user URLs.
Why You Need OneDrive Site URLs
OneDrive site URLs follow a standard format: https://yourtenant-my.sharepoint.com/personal/username_domain_com. However, manually typing these for hundreds of users is impractical. Exporting them programmatically saves time and reduces errors.
Common scenarios that require OneDrive site URLs include:
- Auditing storage usage across all users
- Migrating data to another tenant or service
- Configuring backup tools or third-party connectors
- Generating reports for compliance or management
Both methods described below require a Microsoft 365 Global Admin or SharePoint Admin role. The PowerShell method also requires the SharePoint Online Management Shell module installed on your machine.
Method 1: Export OneDrive Site URLs Using PowerShell
This method gives you the most control. You can filter results, export to a CSV file, and run the script on demand. Prerequisites:
- Install the SharePoint Online Management Shell module:
Install-Module -Name Microsoft.Online.SharePoint.PowerShell - Connect to SharePoint Online using:
Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
- Open PowerShell as Administrator
Right-click PowerShell and select Run as administrator. This ensures the module loads correctly. - Install the SharePoint Online Management Shell module
Run the command:Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Force -AllowClobber. Press Y to accept if prompted. - Connect to SharePoint Online
Run:Connect-SPOService -Url https://yourtenant-admin.sharepoint.com. Replaceyourtenantwith your actual tenant name. Sign in with a Global Admin or SharePoint Admin account. - Retrieve all OneDrive site URLs
Run the command:Get-SPOSite -IncludePersonalSite $true -Limit all | Select-Object Url, Owner, StorageUsageCurrent | Export-Csv -Path C:\OneDriveSites.csv -NoTypeInformation. This exports all OneDrive site URLs, their owners, and current storage usage to a CSV file on your C drive. - Verify the exported file
Open the CSV file in Excel. You should see three columns: Url, Owner, and StorageUsageCurrent. The Url column contains the full OneDrive site URL for each user.
To filter only active sites (exclude deleted or non-provisioned), add this filter: Get-SPOSite -IncludePersonalSite $true -Limit all | Where-Object {$_.Status -eq "Active"} | Select-Object Url, Owner. This ensures you export only URLs for users who have active OneDrive sites.
Method 2: Export OneDrive Site URLs Using Microsoft 365 Admin Center
This method does not require PowerShell and works directly in your browser. It is suitable for administrators who prefer a graphical interface. Prerequisites: Global Admin or Reports Reader role.
- Sign in to Microsoft 365 admin center
Go to https://admin.microsoft.com and sign in with your admin account. - Navigate to Reports > Usage
In the left navigation, select Reports, then select Usage. This opens the usage reports dashboard. - Open the OneDrive report
Scroll to the OneDrive section and select View more. This opens the OneDrive usage report page. - Click the Files tab
On the OneDrive report page, select the Files tab. This shows a list of users with their OneDrive site URLs. - Export the report to CSV
Click the Export button. The admin center generates a CSV file containing user names, OneDrive site URLs, and file counts. Download the file to your computer. - Open the CSV file
Open the downloaded file in Excel. The OneDrive URL column contains the full URL for each user. Note that this report only includes users who have activity or have provisioned a OneDrive site.
Common Limitations and Things to Avoid
OneDrive URLs for users who never signed in
If a user has never signed in to OneDrive, their site may not be provisioned. The PowerShell method includes these as placeholder URLs. The admin center report excludes them. To force provisioning, the user must sign in at https://portal.office.com/onedrive.
Export includes deleted users
The PowerShell method without a filter includes OneDrive sites for deleted users. Use the Where-Object {$_.Status -eq "Active"} filter to exclude them. The admin center report automatically excludes deleted users.
Admin center report shows only active users
The admin center report only includes users who have opened their OneDrive in the last 30 days. For a complete list, use the PowerShell method.
CSV file contains extra columns
Both methods export more than just the URL. You can remove extra columns in Excel or adjust the PowerShell script to select only the Url column.
PowerShell vs Admin Center: Key Differences
| Item | PowerShell Method | Admin Center Method |
|---|---|---|
| Skill level required | Intermediate to advanced | Beginner |
| Includes all users? | Yes, including never-signed-in | Only users with activity in 30 days |
| Includes deleted users? | Yes, unless filtered | No |
| Export format | CSV via script | CSV via download button |
| Extra data available | Storage usage, owner, status | File count, last activity date |
Choose the PowerShell method if you need a complete list of all OneDrive site URLs, including users who never signed in. Choose the admin center method if you want a quick, no-installation export of active users.
Now you can export OneDrive site URLs for all users in your tenant using either PowerShell or the Microsoft 365 admin center. For audits, use the PowerShell script with the active status filter to ensure accuracy. For a quick report of active users, the admin center export is sufficient. As an advanced tip, schedule the PowerShell script as a weekly task using Task Scheduler to automatically generate updated CSV files.