SharePoint Spaces 棄用

SharePoint 空間預計於 2025 年 3 月開始淘汰,支援將於 2025 年 8 月完成。  Microsoft Mesh 提供許多相同的 3D 環境製作工具,並包含多人同時加入活動、以虛擬化身身份呈現,以及透過空間化音訊彼此溝通的能力。 我們推薦你未來探索 Mesh 來滿足沉浸式 3D 體驗的需求。

對於一些現有內容,可能更簡單或更符合你的需求,直接在 SharePoint 內轉換,並使用 SharePoint 頁面,包含圖片、影片等。 用於空間或利用檔案預覽來瀏覽文件庫中的 360° 影像與影片。 這將使內容能編輯、發布及檢視類似 SharePoint 空間的功能。

案例 網狀 SharePoint 空間 SharePoint 頁面
創造三維沉浸式空間
共存與3D沉浸式活動
發布內容以供隨時存取

識別 SharePoint Spaces 內容

你可以使用 SharePoint 搜尋,搜尋你能存取的 SharePoint 空間內容。 在你租戶的頂層 SharePoint 網站,輸入「SPContentType:Space」,搜尋就會回傳你能存取的所有空間。 此視圖可排序以顯示最近建立或修改的空間。

你可以透過瀏覽頁面庫,尋找任何內容類型為「Space」的檔案來辨識網站中的空間內容。 請注意,這個欄位預設不會顯示,所以你可能需要在選擇新增欄位後,在「 顯示或隱藏欄位」 對話框中顯示 它。

透過瀏覽網站的 Pages 函式庫,尋找具有內容類型空間的檔案來識別 SharePoint 空間

範例 PnP PowerShell 腳本,用於識別具有 Spaces 內容的網站

你可以使用 PnP PowerShell 腳本來識別啟用 Spaces 功能的 SharePoint 網站。 以下展示一個範例腳本,幫助你入門。 如果您之前未使用 SharePoint PnP,需依照使用者入門說明建立 EntraAppClientID。 執行此腳本的使用者必須能存取租戶中所有網站,否則該腳本將對使用者無法存取的網站進行失敗;不過,這個腳本會對使用者可存取的所有網站執行到完整,你也可以將多個使用者的結果合併,以達到更廣泛的覆蓋範圍。

$entraAppClientID = ""
# Define the Spaces feature GUIDs
#$featureGuid = "2AC9C540-6DB4-4155-892C-3273957F1926" #use this GUID to check for sites where the feature is currently enabled
$featureGuid = "f4c52091-703d-431c-ac2d-41f9f257052a" #this GUID checks for sites that have ever had the feature enabled and therefore may have spaces in its library

# Connect to SharePoint Online
$adminUrl = "https://.sharepoint.com"
$connection = Connect-PnPOnline -Url $adminUrl -Interactive -ClientId $entraAppClientID -ReturnConnection

# Get all site collections
$sites = Get-PnPTenantSite -Detailed -Connection $connection
$results = @()
foreach ($site in $sites) {
echo $site.Url

     # Connect to the site

     Connect-PnPOnline -Url $site.Url -Interactive -ClientId $entraAppClientID -Connection $connection
     # Check if the MixedReality feature is enabled
     $feature = Get-PnPFeature -Identity $featureGuid -Scope Site               if ($feature.DefinitionId -eq $featureGuid) {
          # Get the pages library
          $pagesLibrary = Get-PnPList -Identity "SitePages"
          echo "Feature On"
          # Get all pages with content type "Space"
          $spacePages = Get-PnPListItem -List $pagesLibrary | Where-Object {$_.FieldValues.MetaInfo -match 'ContentTypeId:SW\|0x0101009D1CB255DA76424F860D91F20E6C41180043153F945E98468297E67C3EEE43AB7000'}
          # Get the total number of spaces
          $totalSpacePages = $spacePages.Count
          # Store the result
          $results += [PSCustomObject]@{
               SiteUrl = $site.Url
               FeatureGuid = $featureGuid
               TotalSpaces = $totalSpacePages
          }
     }
}

# Output the results
$results | Format-Table -AutoSize

僅使用 App 存取權限

如果你沒有能存取所有網站的使用者帳號,可以使用僅限應用程式存取權,並授予 Entra ID 應用程式適當的應用程式權限 (請參閱「設定您自己的 Entra ID 應用程式僅有存取權限」章節,並確保你在為 SharePoint PnP Powershell 建立的權限 sites.read.all 或 sites.full.control) 授予 SharePoint 權限。

當你設定好 Entra ID 應用程式 ID 後,將憑證細節加入腳本:

$certPath = ""
$certPassword = ConvertTo-SecureString -String "[Insert password string]" -AsPlainText -Force
$tenantId = 「[插入租戶ID]」

接著將 Connect-PnPOnline 指令從互動式登入改為僅使用應用程式存取權限:

$connection = Connect-PnPOnline -Url $adminUrl -Interactive -ClientId $entraAppClientID -CertificatePath $certPath -CertificatePassword $certPassword -ReturnConnection

     AND

Connect-PnpOnline -Url $site.Url -ClientId $entraAppClientID -Tenant $tenantId -CertificatePath $certPath -CertificatePassword $certPassword -Connection $connection

使用 PnP PowerShell 停用空間功能

在你想阻止新 Spaces 內容建立的網站上,關閉 SharePoint Spaces 功能可能會很有用。 考慮這麼做的一個原因是,如果你看到網站功能已啟用,但尚未建立任何空格。 這些網站在 2025 年 3 月預設關閉 +New 選單後, 空間選項仍 會顯示在 +New 選單中,除非該功能在網站上被關閉。

以下 PnP PowerShell 指令將停用該網站的功能:

$featureGuid = “2AC9C540-6DB4-4155-892C-3273957F1926”
Connect-PnPOnline -Url -Interactive -ClientId $entraAppClientID -Connection $connection
Disable-PnPFeature -Scope Web -Identity $featureGuid -Force

注意

  • 現代化工具及所有其他 PnP 元件皆為開源工具,並由活躍社群支持。 官方 Microsoft 支援管道對開源工具的支援沒有 SLA。
  • 本範例僅按現狀提供,不提供任何明示或暗示的保證,包括任何默示的適合特定用途、可銷售性或非侵權的保證