RestoreEncryptionKey 方法 (WMI MSReportServer_ConfigurationSetting)

將指定的加密金鑰重新套用至報表伺服器資料庫。

語法

Public Sub RestoreEncryptionKey(ByRef KeyFile() As Integer, _
    ByRef Length As Int32, ByVal Password As String, _
    ByRef HRESULT As Int32, ByRef ExtendedErrors() As String)
public void RestoreEncryptionKey(out Byte[] KeyFile, out Int32 Length, 
            string Password, out Int32 HRESULT, out string[] ExtendedErrors);

參數

  • KeyFile[]
    [out] 包含已加密之加密金鑰的陣列。

  • Length
    [out] 此方法所傳回之陣列的長度。

  • Password
    用來加密加密金鑰的字串。

  • HRESULT
    [out] 指出呼叫成功或失敗的值。

  • ExtendedErrors[]
    [out] 包含呼叫所傳回之其他錯誤的字串陣列。

傳回值

傳回 HRESULT,指出方法呼叫成功或失敗。值為 0 表示方法呼叫成功。非零值則表示已發生錯誤。

備註

如果報表伺服器的項目已經存在報表伺服器資料庫中,就會刪除此項目。然後,系統會使用指定的加密金鑰和報表伺服器的公開金鑰來建立新的項目。

在清除加密金鑰清單的 DeleteEncryptionKey 方法之後呼叫此方法最有效。

需求

**命名空間:**root\Microsoft\SqlServer\ReportServer\RS_<EncodedInstanceName>\v10\Admin

**平台:**Windows Server 2003 Datacenter Edition;Windows Server 2003 Enterprise Edition;Windows Server 2003 Standard Edition;Windows Vista;Windows XP Professional Service Pack 2 (SP2) 或 Service Pack 1 (SP1);或 Windows 2000 (所有版本)