Get a list of all user OneDrive URLs in your organization

This article is for global and SharePoint admins in Microsoft 365.

View the list of OneDrive users and URLs in your organization

  1. Sign in to as a global or SharePoint admin. (If you see a message that you don't have permission to access the page, you don't have Microsoft 365 admin permissions in your organization.)


    If you have Office 365 Germany, sign in at If you have Office 365 operated by 21Vianet (China), sign in at Then select the Admin tile to open the admin center.

  2. In the left pane, select Reports > Usage. (You might need to select Show all to see the Reports option.)

  3. Select the OneDrive files tile, or select Select a report > OneDrive usage.


    If you see GUIDs in the report instead of URLs and names, in the left pane, select Settings > Services & add-ins, and then select Reports. Clear the box Display anonymous identifiers instead of names in all reports.

  4. In the upper right of the table at the bottom, select 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.

  1. Download the latest SharePoint Online Management Shell.


    If you installed a previous version of the SharePoint Online Management Shell, go to Add or remove programs and uninstall "SharePoint Online Management Shell."

  2. 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 admin center URL"
    $LogFile = [Environment]::GetFolderPath("Desktop") + "\OneDriveSites.log"
    Connect-SPOService -Url $TenantUrl
    Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like ''" | Select -ExpandProperty Url | Out-File $LogFile -Force
    Write-Host "Done! File saved as $($LogFile)."
  3. Open the SharePoint Online Management Shell. Navigate to the directory where the script has been saved and run:

    PS C:\>.\OneDriveSites.ps1


    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.

  4. The script will prompt you for the SharePoint admin center URL. For example, is the Contoso SharePoint admin center URL.

  5. You will then be prompted to sign in. Use a SharePoint admin or global admin 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.

More information

Once you have the URL for a user's OneDrive, you can get more info about it by using the Get-SPOSite cmdlet, and change settings by using the Set-SPOSite cmdlet.