Protect-SCSMManagementPack

將管理組件密封,預防他人修改管理組件。

Syntax

Protect-SCSMManagementPack
       [-ManagementPack] <ManagementPack[]>
       -OutputDirectory <String>
       -KeyFilePath <String>
       -CompanyName <String>
       [-Copyright <String>]
       [-PassThru]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Protect-SCSMManagementPack
       [-ManagementPackFile] <String[]>
       -OutputDirectory <String>
       -KeyFilePath <String>
       -CompanyName <String>
       [-Copyright <String>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

Protect-SCSMManagementPack Cmdlet 會密封管理元件以防止修改。 密封管理元件會儲存在 OutputDirectory 參數所指定的資料夾中。 密封管理元件可以匯入 smshort。

範例

範例 1:密封管理元件

PS C:\>$Mp = Get-SCSMManagementPack -ManagementPackFile "Resources\ContosoForm.xml"
PS C:\> $Arguments = @{
>> ManagementPack = $Mp
>> OutputDirectory = $PWD
>> KeyFilePath = "Resources\keyfile.snk"
>> CompanyName = "Contoso"
>> Copyright = "2011"}
PS C:\> Protect-SCSMManagementPack @Arguments

這些命令會密封管理元件 ContosoForm.xml。

參數

-CompanyName

指定密封管理元件簽章的公司名稱。

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

在執行 Cmdlet 前提示您確認。

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

指定密封管理元件簽章的著作權字串。

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyFilePath

指定檔案的路徑,此檔案包含密封管理組件之簽章的金鑰。

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ManagementPack

指定要密封的管理組件。 您可以輸入Get-SCSMManagementPack Cmdlet 所傳回的ManagementPack物件。

Type:Microsoft.EnterpriseManagement.Configuration.ManagementPack[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ManagementPackFile

指定管理組件檔案的名稱。

Type:System.String[]
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OutputDirectory

指定密封管理元件的資料夾。

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PassThru

指定代表密封管理組件的輸出物件。 此輸出物件可以傳遞給其他指令程式。

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 Cmdlet 並不會執行。

Type:System.Management.Automation.SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

輸入

System.String

您可以使用管線將管理元件檔案名傳送至 Cmdlet 的 Protect-SCSMManagementPackManagementPackFIle參數。

Microsoft.EnterpriseManagement.Configuration.ManagementPackManagement pack object.

您可以使用管線將管理元件物件傳送至Protect-SCSMManagementPack Cmdlet 的ManagementPack參數,例如Get-SCSMManagementPack Cmdlet 所傳回的物件。

輸出

Management pack object.

此 Cmdlet 會在與 PassThru 參數搭配使用時產生管理元件物件。

Sealed management pack.

此 Cmdlet 會產生密封管理元件,儲存在 OutputDirectory 參數所指定的資料夾中。