当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 如何在SharePoint Online中获取租户ID?

作者:精品下载站 日期:2024-12-14 15:30:57 浏览:14 分类:玩电脑

如何在SharePoint Online中获取租户ID?


要求:从 SharePoint Online 获取租户 ID。

我的 SharePoint Online 租户 ID 是什么?

当您订阅 Office 365 时,您将被分配一个唯一标识符作为您的租户 ID。此租户 ID 是链接 Office 365 环境中所有服务的 GUID。有时,您可能需要知道您的租户 ID,例如,在部署第 3 方应用程序时、为 OneDrive for Business、PowerBI Adoption Pack 等设置组策略时。那么,如何检索我的租户 ID?在本文中,我们将讨论在 SharePoint Online 中查找租户 ID 的多种方法,包括使用 SharePoint Online 管理中心、SharePoint Online PowerShell 模块和 Microsoft Azure Active Directory PowerShell 模块。

以下是在 Microsoft 365/SharePoint Online 中查找租户 ID 的一些方法:

从 SharePoint Online 管理中心获取租户 ID:

要从 SharePoint Online 获取租户 ID,请执行以下步骤:

  1. 登录您的 SharePoint 管理中心:https://tenant-admin.sharepoint.com
  2. 在 SharePoint 管理中心,单击左侧导航中的“更多功能”链接 >> 单击“应用程序”下的“打开”按钮,导航至应用程序页面
  3. 在“应用程序”页面中,单击“更多功能”>>“应用程序权限”链接。 (网址快捷方式:https://tenant-admin.sharepoint.com/_layouts/15/TA_AllAppPrincipals.aspx
  4. 应用程序权限页面列出了所有应用程序、显示名称和应用程序标识符。在“应用程序标识符”列中,@符号后面得到的是我们的Office 365租户ID。因此,在我的例子中,租户 ID 是“fa3d1825-7b1c-42c6-bbce-cxah5a6dd192”

    [玩转系统] 如何在SharePoint Online中获取租户ID?

同样,您可以从网站设置导航到网站集的任何“应用程序权限”页面 (https://tenant.sharepoint.com/_layouts/15/AppPrincipals.aspx) 以获取租户 ID (如果有注册的应用程序,顺便说一句!)。

PnP PowerShell 在 SharePoint Online 中查找获取租户 ID

以下是如何使用 PnP PowerShell 在 SharePoint Online 中获取租户 ID:


#Parameters
$TenantSiteURL =  "https://crescent-admin.sharepoint.com"

#Connect to the tenant admin
Connect-PnPOnline -Url $TenantSiteURL -Credentials (Get-Credential)

#Get the Tenant ID
Get-PnPTenantID 

您还可以通过以下方式获取租户 ID:


#Set Config Parameter
$SiteURL = "https://crescent.sharepoint.com/"

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#Get Tenant ID
Get-PnPAuthenticationRealm

从 Azure AD 获取租户 ID

我们可以使用 PowerShell 从 Azure AD 检索租户 ID,如下所示:


#Get credentials
$Cred = Get-Credential

#Connect to Azure AD
Connect-AzureAD -Credential $Cred | Select TenantDomain, TenantId

您还可以从 Azure 门户获取租户 ID。只需登录到 Azure 门户 https://portal.azure.com 并打开 Azure Active Directory 模块属性。您将在下面的屏幕截图中找到租户 ID:

[玩转系统] 如何在SharePoint Online中获取租户ID?

查找任何 Microsoft 365 域的租户 ID

您还可以使用 URL https://login.microsoftonline.com//.well-known/openid-configuration 查找任何域的租户 ID。例如,https://login.microsoftonline.com/crescent.com/.well-known/openid-configuration,然后获取租户 ID:

[玩转系统] 如何在SharePoint Online中获取租户ID?

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯