分享方式:


透過社群中樞註冊主控台擴充功能

主控台擴充功能作者可以貢獻他們寫入社群中樞的延伸模組。 社群中樞使用者可以下載擴充功能,並管理其Configuration Manager階層的安裝。 透過社群中樞參與擴充功能會取代 先前的部署程式

版本資訊

若要從社群中 下載主控台擴充功能,您需要下列其中一項:

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

您可以使用下列版本在本機 入,以測試您自己簽署的延伸模組:

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

您可以 在本機匯入未簽署的延伸模組 。 未簽署的延伸模組僅供本機匯入和測試之用。 未簽署的延伸模組無法提交至社群中樞。 匯入未簽署的擴充功能需要下列其中一個版本:

從 2111 版開始,您可以使用 [匯入主控台擴充功能精靈] 匯入已簽署和未簽署的延伸模組。

先決條件

若要在社群中樞註冊主控台擴充功能,Configuration Manager系統管理員下載,您將需要下列必要條件:

  • 符合參與社群中樞的所有必要條件

  • Configuration Manager具有所有範圍許可權的系統高版權管理員

  • 準備好發佈之後,驗證簽署 .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 檔案

建立有效的承載 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. 編輯 $adminServiceProvider$cabFilePath 之後,請執行下列 PowerShell 腳本:

    • $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 腳本,將會覆寫目前現有的版本。

在社群中樞上共用您的擴充功能

僅適用于 technical Preview 版本的 Configuration Manager

請確定您已加入社群中樞,而且在您的加入要求獲得核准之後,您已接受邀請。 您參與擴充功能的方式與 參與其他社群中樞物件的方式相同。 不過,針對其他需求和其他資訊,您需要提供擴充功能。 當您將主控台擴充功能提供給社群中樞時,必須簽署內容。 主控台擴充功能的內容不是由Microsoft所裝載。 當您參與專案時,系統會要求您提供已簽署 .cab 檔案的位置,以及擴充功能的其他資訊。 參與延伸模組需要下列專案:

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

重要事項

如果您透過系統管理服務在本機將擴充功能匯入主控台,如果您嘗試從社群中樞下載相同的擴充功能,下載將會失敗。 若要測試從社群中樞下載延伸模組,請刪除匯入的延伸模組,然後從社群中樞下載。

後續步驟