Share via

How do i find a site's name using 'site_id'?

Edward 21 Reputation points
2026-04-06T15:06:55.3466667+00:00

Let's say you have a site_id.

How would i be able to find which SharePoint Online site it's referring to?

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments

2 answers

Sort by: Most helpful
  1. Chris Duong 8,050 Reputation points Microsoft External Staff Moderator
    2026-04-06T15:45:34.9666667+00:00

    Hi @Edward

    I hope you’re having a great day. I appreciate your patience and the details you provided. 

    A straightforward way to find which site it refers to is to query Microsoft Graph for that site and read the returned webUrl (the actual SharePoint site URL) and display name.  

    You may choose one of the options below that best suits your needs. 

    Option A - Microsoft Graph (recommended if the site_id is in Graph format): 

    You can retrieve the site details (including webUrl) by calling: 

    GET https://graph.microsoft.com/v1.0/sites/{site-id} 

    This returns the site properties and the SharePoint URL in webUrl. 

    Option B - If you only have a GUID and need a tenant-wide lookup: 

    If the ID you have is a GUID and you need to map it back to a site collection, admins can use PnP PowerShell at the tenant admin level to look up the site by its Id. 

    For additional information, you can refer to these articles:  

    This link is shared by community members for your convenience. It points to a third-party site that is not managed or verified by Microsoft. We can’t guarantee the quality, safety, or suitability of any content or software found there. Please review carefully and make sure you understand any potential risks before using it. 

    In case you require more in-depth guidance or support for these steps, I’d recommend posting your query in the Microsoft Power Automate Community. This is a dedicated channel for Power Automate discussions. The reason I suggest posting a new topic there is that in the general Q&A Forum, resources and expertise on Power Automate are limited. In the Microsoft Power Platform Community Forum, you’ll find the most qualified group of respondents, and other partners who regularly read the forums can share their knowledge or learn from your interaction. 

    User's image

    I hope this information is helpful. Should you have any further questions or need additional assistance, feel free to reach out.    

    Thank you again for your understanding and cooperation. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any extra questions about this answer, please click "Comment".  

    Note: Follow the steps in our documentation to enable email notifications if you want to receive email notifications related to this topic.    

    0 comments No comments

  2. Q&A Assist
    2026-04-06T15:07:05.81+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    A SharePoint Online site ID can be resolved to the actual site (and its name) by querying the site resource via Microsoft Graph or the SharePoint/OneDrive site API.

    Two common approaches:

    1. Using Microsoft Graph PowerShell (Get-MgSite)
      If the site ID is the Graph site-id (the composite ID), use the Microsoft.Graph.Sites module:
         # Connect first (for example with delegated permissions)
         Connect-MgGraph -Scopes "Sites.Read.All"
         
         # Replace {site-id} with the site_id value
         $site = Get-MgSite -SiteId '{site-id}'
         $site.DisplayName
         $site.WebUrl
      
      Get-MgSite “retrieves properties and relationships for a site resource. A site resource represents a team site in SharePoint.” The returned object includes properties such as the site’s display name and URL, which identify which SharePoint site the site_id refers to.
    2. Using the Sites REST endpoint (Graph/OneDrive site API)
      If calling the API directly, use the GET /sites/{site-id} pattern:
         GET /sites/{site-id}
      
      As documented for “Get a site resource”, this returns the site resource for that ID, including its name and URL. A site is addressed by a unique composite ID, and GET /sites/{site-id} resolves that ID to the actual SharePoint site.

    Once the site resource is retrieved by either method, inspect its name/displayName and webUrl to know which SharePoint Online site the site_id represents.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.