Get a list of all user OneDrive Urls in your organization
This article is for Global Admins and SharePoint Admins in Office 365.
View the list of OneDrive users and Urls in your organization
Sign in to Office 365 as a Global Admin or SharePoint Admin.
Select the app launcher icon in the upper-left and choose Admin to open the Microsoft 365 admin center. (If you don't see the Admin tile, you don't have Office 365 administrator permissions in your organization.)
In the left pane, select Reports, and then select Usage.
Click the OneDrive files tile, or click Select a report, and then click OneDrive usage.
In the upper right of the table at the bottom, click Export.
Create a list of all the OneDrive Urls in your organization using Microsoft PowerShell
The list you create in these steps will be saved to a text file.
Save the following text to a PowerShell file. For example, you could save it to a file named OneDriveSites.ps1.
$TenantUrl = Read-Host "Enter the SharePoint Online Tenant Admin Url" $LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log" Connect-SPOService -Url $TenantUrl Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/" |select Url | Out-File $LogFile -Force Write-Host "Done! File saved as $($LogFile)."
- Open the SharePoint Online Management Shell. Navigate to the directory where the script has been saved and run:
> [!NOTE] > If you get an error message about being unable to run scripts, you might need to change your execution policies. For info, see [About Execution Policies](https://go.microsoft.com/fwlink/?linkid=869255).
The script will prompt you for the SharePoint Online tenant admin Url. For example, "https://contoso-admin.sharepoint.com" is the Contoso SharePoint Online tenant admin Url.
You will then be prompted to log into the tenant. Use a SharePoint Online Administrator or Global Administrator account.
After the script successfully completes, a text file is created in the location specified by the $LogFile variable in the script. This file contains a list of all OneDrive Urls in your organization. The following text provides an example of how the list of Urls in this file should be formatted.
Url --- https://contoso-my.sharepoint.com/personal/annb_contoso_onmicrosoft_com/ https://contoso-my.sharepoint.com/personal/carolt_contoso_onmicrosoft_com/ https://contoso-my.sharepoint.com/personal/esterv_contoso_onmicrosoft_com/ https://contoso-my.sharepoint.com/personal/hollyh_contoso_onmicrosoft_com/