web analytics
Find SharePoint URL given Site ID
Microsoft 365,  SharePoint

Find SharePoint URL with Site ID

Some weeks ago, I had noted the site ID for a SharePoint Online site for a project with Microsoft. However, I did not make note of the URL of the site and needed to get to the site. So that left me with the question ‘How do I find the SharePoint URL when I have the Site ID?'

The Site ID

Many moons ago, I was asked to provide the site ID. I found the site ID by simply adding /_api/site/id to the URL of the site. At this point, I should have also written down the site URL! If I had, I guess I would not be writing this post. 🙂

At the time, this is how I found the SharePoint site ID.

https://<TenantName>.sharepoint.com/sites/<site>/_api/site/id

For example:  https://MyAmazingTenant77.sharepoint.com/sites/WonderfulSite/_api/site/id

This will give you the “d:Id” which is the site ID, the Globally Unique Identifier (GUID) assigned to that particular site.

Find SharePoint site ID
Find SharePoint site ID

Find SharePoint URL with Site ID

You COULD go through every site manually – navigate to each one, add /api/site/id to the URL, and see if the ID matches. This could take a very long time if you have hundreds or thousands of SharePoint sites.

The SIMPLE way is to use Microsoft Search to your advantage! Go to Microsoft365.com and ensure you are logged in to the correct tenant. Then do a search for id:”<SiteID>”.

For example, if my site ID was 00000000-0000-0000-0000-000000000000, then the search would be:

id:00000000-0000-0000-0000-000000000000

Performing this search will present you images that have been used on the site, including the site icon and images that have been uploaded automatically when you added them to a page from your computer. The site name is listed under the image name – click on the image to see the full URL.

Find SharePoint URL with Site ID
Find SharePoint URL with Site ID

Use PowerShell to find SharePoint URL

If nothing is returned in your search, or if you would like to find the URL via PowerShell, you are in luck! Using PnP PowerShell, we can use the cmdlet Get-PnPTenantSite.

For example, if my site ID was 00000000-0000-0000-0000-000000000000, then the command would be:

Get-PnPTenantSite 00000000-0000-0000-0000-000000000000

Find SharePoint URL with Site ID with PowerShell
Find SharePoint URL with Site ID with PowerShell

Special thanks to fellow Microsoft MVP Drew Madelung for helping me tracking down what cmdlet to use.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

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