Below you will find pages that utilize the taxonomy term “Get Site Id”
posts
Retrieving SiteId from Microsoft Graph for Subsequent API Calls
Retrieving SiteId from Microsoft Graph for Subsequent API Calls This post offers an option to retrieve a SiteId from Microsoft Graph using PnP PowerShell. This can be particularly useful when making further API calls that require the SiteId.
$siteurl = "https://contoso.sharepoint.com/sites/Company311" Connect-PnPOnline -url $siteurl -interactive # for the site url https://contoso-admin.sharepoint.com/teams/app-m365 # Extract the domain and site name $uri = New-Object System.Uri($siteurl) $domain = $uri.Host $siteName = $uri.AbsolutePath # Construct the new URL $RestMethodUrl = "v1.