Discovering URLs for SharePoint Online and OneDrive for Business Sites

URLs Needed for Office 365 Content Searches

The topic of how best to find the URL of someone’s OneDrive for Business account arose in the context of Office 365 content searches. You need to know the URL of any SharePoint Online site or OneDrive for Business account before you can include it in the locations scanned by a content search (Figure 1), eDiscovery case, or Office 365 retention policy.

Some OneDrive for Business accounts added to an Office 365 content search
Figure 1: Some OneDrive for Business accounts added to an Office 365 content search

Finding URLs for SharePoint Sites

Finding the URL of a SharePoint site is straightforward, especially if the site is connected to an Office 365 Group (team). You can:

  • Open the SharePoint site from the group or Teams and note the URL.
  • Run PowerShell to find the URL.
  • Look at the site details in the SharePoint Admin Center to find the URL (Figure 2).
Finding the URL of a site through the SharePoint Admin Center
Figure 2: Finding the URL of a site through the SharePoint Admin Center

We can find the URL with the SharePoint Online PowerShell module or the Exchange Online module. First, here’s SharePoint Online where we use the filter parameter with the Get-SPOSite cmdlet to find all sites containing “Ben” in the URL:

The Get-UnifiedGroup cmdlet in the Exchange Online module can return details of any group-enabled site:

Finding URLs for OneDrive for Business Accounts

The OneDrive for Business Admin Center doesn’t list OneDrive accounts: neither does the SharePoint Admin Center. However, we can find the URLs as follows:

  • By accessing a user’s Delve profile and following the link to their OneDrive account.
  • With PowerShell.

PowerShell is probably the easiest method because you can create a list of all OneDrive for Business accounts in the tenant and keep it for easy reference. After connecting to the SharePoint Online PowerShell module with an administrator account, run this command to generate a CSV file with all the links. Figure 3 shows an example of what the CSV file contains.

A list of OneDrive for Business Accounts Generated in CSV format
Figure 3: A list of OneDrive for Business Accounts Generated in CSV format

Apart from being a useful reference, generating a list of OneDrive accounts also allows you to identify any accounts belonging to long-deleted accounts that should no longer be online (I found a couple from 2013).


Tracking down tips like this can be very time-consuming. Wouldn’t it be much better to be able to consult a comprehensive, always up-to-date manual. Something like the Office 365 for IT Pros eBook?

Advertisements

3 Replies to “Discovering URLs for SharePoint Online and OneDrive for Business Sites”

    1. Have you tried? And in any case, you can filter the URLs returned by OneDrive to select just the ones you want to export to the CSV.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.