Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在sharepoint管理中心中查找站点ID_Sharepoint_Microsoft Graph Api_Azure Ad Graph Api - Fatal编程技术网

在sharepoint管理中心中查找站点ID

在sharepoint管理中心中查找站点ID,sharepoint,microsoft-graph-api,azure-ad-graph-api,Sharepoint,Microsoft Graph Api,Azure Ad Graph Api,我正在sharepoint管理中心中查找siteID,但找不到它。我可以通过graphAPI获得它,但我也需要通过管理中心找到它,原因是我们的客户有多租户应用程序,他们希望每个租户在应用程序中输入自己的sharepoint/graphAPI设置。我认为不可能从SPO管理中心获得sharepoint Online站点的站点Id。您可以使用Microsoft Graph、SharePoint Online PowerShell、客户端对象模型CSOM等。此外,如果您在浏览器中导航到一个站点并将/_a

我正在sharepoint管理中心中查找siteID,但找不到它。我可以通过graphAPI获得它,但我也需要通过管理中心找到它,原因是我们的客户有多租户应用程序,他们希望每个租户在应用程序中输入自己的sharepoint/graphAPI设置。

我认为不可能从SPO管理中心获得sharepoint Online站点的站点Id。您可以使用Microsoft Graph、SharePoint Online PowerShell、客户端对象模型CSOM等。此外,如果您在浏览器中导航到一个站点并将/_api/site附加到URL,您可以看到该站点的Guid,但您需要解析XML响应。

似乎无法在CA中获取站点id

我编写了一个pnp powershell脚本,以获取所有站点id供您参考

$username = "amos@contoso.onmicrosoft.com"
$password = "Password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)

$TenantSiteURL =  "https://contoso-admin.sharepoint.com/"
$CSVFilePath = "C:\Temp\AllSitesData.csv"

#Connect to Tenant Admin Site
Connect-PnPOnline -Url $TenantSiteURL -Credentials $cred
$sites=Get-PnPTenantSite -Detailed
$listItemData=@()
foreach($site in $sites){
    Connect-PnPOnline -Url $site.Url -Credentials $cred

    #Get the site collection with ID property
    $Site = Get-PnPSite -Includes ID

    $listItemData += New-Object PSObject -Property @{
        "Site Url" = $site.Url
"Site Collection ID" = $Site.Id                 

}            
}
$listItemData |Export-Csv -NoTypeInformation -Path $CSVFilePath

如上所述,您需要访问管理中心。不要使用Get-PnPTenantSite,而是使用

Get PnPListItem-List DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS-PageSize 5000 | Where Object{}