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

[玩转系统] 如何使用 PowerShell 在 SharePoint Online 中查找网站模板?

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

如何使用 PowerShell 在 SharePoint Online 中查找网站模板?


要求:使用 PowerShell 在 SharePoint Online 中查找网站模板。

如何在 SharePoint Online 中查找网站模板?

您可能有一个现有网站,并且想了解在 SharePoint Online 中创建该网站时使用的网站模板。在本文中,我将向您展示如何在 SharePoint Online 中查找网站模板。例如,您可能想知道它是否是 SharePoint Online 中的团队网站。

要检查站点的站点模板,请执行以下操作:

  1. 在浏览器中打开 SharePoint Online 网站集或子网站,转到“查看>>页面源”。
  2. 在页面源中,搜索“webTemplateConfiguration”,接下来您将找到站点模板值。

    [玩转系统] 如何使用 PowerShell 在 SharePoint Online 中查找网站模板?

您可以参考这篇文章获取所有网站模板 ID 使用 PowerShell 在 SharePoint Online 中获取网站模板

如何使用 PowerShell 在 SharePoint Online 中查找网站模板?

使用此 PowerShell 获取网站集的网站模板:


#Set Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"
$SiteURL="https://crescent.sharepoint.com/sites/marketing"

#Connect to SharePoint Online
Connect-SPOService -Url $TenantAdminURL -Credential (Get-Credential)

#Get Site Template of the Site Collection
(Get-SPOSite -Identity $SiteURL).Template

使用 PowerShell 获取子网站的网站模板

让我们使用 PnP PowerShell 检索子网站的模板。


#Set Parameters
$SiteURL="https://crescent.sharepoint.com/sites/marketing/us"

#Connect to Site
Connect-PnPOnline $SiteURL -Credentials (Get-Credential)  #-Interactive

#Get Template of the Web
$Web = Get-PnPWeb -Includes Configuration, WebTemplate

Write-host "Site Template: $($Web.WebTemplate)#$($Web.Configuration)"

您还可以使用“SharePoint Manager”工具来获取SharePoint Online网站的网站模板,如我的另一篇文章:如何获取SharePoint网站中使用的Web模板?

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

取消回复欢迎 发表评论:

关灯