共用方式為


透過社群中心註冊主機擴充功能

主控台擴充功能的作者可以將他們寫的擴充功能貢獻到社群中心。 社群樞紐用戶可以下載擴充功能,並在其 Configuration Manager 階層中管理安裝。 透過 Community Hub 貢獻擴充功能會取代 先前的部署流程

版本資訊

要從 社群中心下載主控台擴充功能,你需要以下其中之一:

  • Configuration Manager 的技術預覽版本
  • Configuration Manager 版本 2103 或更新版本

你可以透過 本地匯入 以下版本來測試自己的簽名擴充功能:

  • Configuration Manager 的技術預覽版本
  • Configuration Manager 版本 2103 或更新版本

你可以在本地 匯入未簽署的擴充功能 。 未簽署的擴充功能僅供本地匯入和測試用途。 未簽署的擴充功能無法提交到 Community hub。 匯入未簽署的擴充功能需要以下其中一個版本:

從 2111 版本開始,你可以透過 匯入主控台擴充功能 精靈匯入已簽署與未簽署的擴充功能。

必要條件

要在社群中心註冊主控台擴充功能,供 Configuration Manager 管理員下載,您需要以下先決條件:

  • 符合所有貢獻社群中心的先決條件

  • Configuration Manager 完全管理員,擁有所有範圍權限。

  • 一旦準備好發佈,就在 authenticode 簽署.cab的檔案中取得有效有效載荷。 您的 .cab 檔案必須包含以下項目:

    • 一個名為 manifest.xml
    • 擴充功能的作者及 版本 必須在 manifest.xml
    • 所有與該擴充功能相關的檔案都必須在檔案中.cab
      • 每個檔案必須在清單中列出,且名稱正確且 SHA256 雜湊值為準

建立擴充功能

為社群中心建立擴充功能,其實和以前沒什麼兩樣。 不過,現在就不需要再把檔案安裝到各自的 %ProgramFiles%\Microsoft Endpoint Manager\AdminConsole\XmlStorage\Extensions 資料夾裡了。 這是新 manifest.xml 檔案的功能之一。 你仍然可以創建以下物品:

  • 動作
  • 表單
  • 管理課程
  • Nodes
  • 檢視
  • 利用你選擇的精靈框架,將自訂精靈整合到 Configuration Manager 主控台
    • 你無法用現有的 Configuration Manager 控制台框架來建立精靈。
    • 你無法修改或移除現有 Configuration Manager 精靈的步驟。

提示

你可以從社群中心的 GitHub 倉庫下載 範例副檔名的 cab 檔

建立有效的有效載荷駕駛艙檔案

當你建立好副檔名的檔案後,再建立 manifest.xml 檔案,然後把它們打包成一個有 authenticode 簽名的 .cab 檔案。

  • 一個有效載荷,存在於 authenticode 簽名 .cab 檔案中。 您的 .cab 檔案必須包含以下項目:
    • 一個名為 manifest.xml
    • 擴充功能的作者及 版本 必須在 manifest.xml
    • 所有與該擴充功能相關的檔案都必須在檔案中.cab
      • 每個檔案必須在清單中列出,且名稱正確且 SHA256 雜湊值為準

Manifest.xml 格式:

<CustomExtensionManifest ExtensionID="{A GUID to identify this extension}" Name="{Name of the extension to be shown in the Console Extension node}" Description="{Description of the extension to be shown in the Console Extension node" Version="{The version of the extension to be shown in the Console Extension node. For example:1.0}" Author="{The author of the extension to be shown in the Console Extension node}">
	<Deployments>
		<ActionExtensionDeployment ParentNode="{the GUID that identify the folder/node you want to place the action under}">
			<FileList>
				<File Name="{The name of the xml file that defines the action. For example: MyAction.xml}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
			</FileList>
		</ActionExtensionDeployment>
		<NodeExtensionDeployment ParentNode="{the GUID that identify the folder you want to place the node under}">
			<FileList>
				<File Name="{The name of the xml file that defines the node. For example: MyNode.xml}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
			</FileList>
		</NodeExtensionDeployment>
		<FormExtensionDeployment>
			<FileList>
				<File Name="{The name of the xml file that defines the form. For example: MyForm.xml}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
				<File Name="{The name of the dll file that defines the form. For example: MyForm.dll}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
			</FileList>
		</FormExtensionDeployment>
		<ManagementClassExtensionDeployment>
			<FileList>
				<File Name="{The name of the xml file that defines the WMI class. For example: MyClass.xml}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
				<File Name="{The name of the dll file that defines the WMI class. For example: MyClass.dll}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
			</FileList>
		</ManagementClassExtensionDeployment>
		<ViewExtensionDeployment>
			<FileList>
				<File Name="{The name of the dll file that defines the view. For example: MyView.dll}">
					<Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
				</File>
			</FileList>
		</ViewExtensionDeployment>
        <CabExtensionDeployment>
            <FileList>
                <File Name="{The name of the cab file to deploy. CabExtensionDeployment is used when your payload cab file contains a cab within it that needs to be deployed.  For example: MyCab.cab}">
                    <Hash Algorithm="sha256">{The SHA256 hash of this file}</Hash>
                </File>
            </FileList>
        </CabExtensionDeployment>
	</Deployments>
</CustomExtensionManifest>

檔案範例 manifest.xml:

<CustomExtensionManifest ExtensionID="808b9ce3-e574-49be-82be-64ed35d800c5" Name="Nice Console Node and Console Action Extension" Description="Very Useful Extension" Version="1.1" Author="Me">
	<Deployments>
		<NodeExtensionDeployment ParentNode="d61498cb-7b3f-4748-ae3e-026674fb0cbd">
			<FileList>
				<File Name="Test.xml">
					<Hash Algorithm="sha256">543F2947AEA734B6833F275091AC6A159C0FCD341373D6E53062E37281B602B3</Hash>
				</File>
			</FileList>
		</NodeExtensionDeployment>
      <ActionExtensionDeployment ParentNode="172d85e7-bb7a-4479-a6a2-768f175b75cb">
        <FileList>
          <File Name="Test2.xml">
            <Hash Algorithm="sha256">C60FB69B86BF9B2E924FF272292CA2C97864D636B8190C95DC926049651A002E</Hash>
          </File>
        </FileList>
      </ActionExtensionDeployment>
	</Deployments>
</CustomExtensionManifest>

將擴展機註冊到某個網站進行測試

當你的擴充功能建置並打包成 authenticode 簽署.cab的檔案後,可以在 Configuration Manager 實驗室環境中測試。 你必須透過 管理服務發布。 一旦擴充功能插入網站,你可以透過 控制台擴充 節點核准並本地安裝。

重要事項

在本地測試時,你可以在使用 2107 版本或更新版本時匯入未簽署的主控台擴充功能。 欲了解更多資訊及更多匯入方法,請參閱 匯入主控台擴充功能

  1. 編輯 和 $cabFilePath後執行以下 PowerShell 腳本$adminServiceProvider

    • $adminServiceProvider - 安裝管理服務的頂層 SMSProvider 伺服器
    • $cabFilePath - 通往擴充功能authenticode簽名 .cab 檔案的路徑
    $adminServiceProvider = "SMSProviderServer.contoso.com"
    $cabFilePath = "C:\Testing\MyExtension.cab"
    $adminServiceURL = "https://$adminServiceProvider/AdminService/v1/ConsoleExtensionMetadata/AdminService.UploadExtension"
    $cabFileName = (Get-Item -Path $cabFilePath).Name
    $Data = Get-Content $cabFilePath
    $Bytes = [System.IO.File]::ReadAllBytes($cabFilePath)
    $base64Content = [Convert]::ToBase64String($Bytes)
    
    $Headers = @{
        "Content-Type" = "Application/json"
    }
    
    $Body = @{
                CabFile = @{
                    FileName = $cabFileName
                    FileContent = $base64Content
                }
            } | ConvertTo-Json
    
    $result = Invoke-WebRequest -Method Post -Uri $adminServiceURL -Body $Body -Headers $Headers -UseDefaultCredentials
    
    if ($result.StatusCode -eq 200) {Write-Host "$cabFileName was published successfully."}
    else {Write-Host "$cabFileName publish failed. Review AdminService.log for more information."}
    
  2. 在 Configuration Manager 主控台中,前往管理>總覽>匯報與服務>主控台擴充功能

  3. 選擇你的擴充功能,然後選擇 「批准安裝」。

  4. 要在目前主控台安裝擴充功能,請在本地擴充功能中選擇安裝

  5. 用相同的副檔名和版本重執行 PowerShell 腳本會覆蓋目前的程式碼。

在 Community Hub 分享你的延伸

僅適用於技術預覽版的 Configuration Manager

請確認你已經加入社群中心,並且在申請通過後已經接受邀請。 你貢獻擴充功能的方式,就像貢獻 其他社群樞紐物件一樣。 不過,延期時還有額外的要求和資訊需要提供。 當你向 Community hub 貢獻主機擴充功能時,內容必須簽署。 主機擴充的內容並非由 Microsoft 托管。 當你提交商品時,系統會要求你提供已簽署 .cab 檔案的地點及其他延期相關資訊。 貢獻擴充所需的項目如下:

  • 內容網址:可 .cab 下載檔案的位置
  • 內容的 SHA-256 雜湊值:檔案的 SHA-256 雜湊 .cab
  • 授權網址:擴充功能授權的網址,例如 https://mit-license.org/
  • 隱私聲明網址:您的隱私聲明網址

重要事項

如果你透過管理服務將擴充功能匯入本地主機,嘗試從社群中心下載相同擴充功能時,下載會失敗。 要測試從 Community Hub 下載擴充功能,先刪除匯入的擴充功能,然後再從 Community hub 下載。

後續步驟