SetSecureConnectionLevel 方法 (WMI MSReportServer_ConfigurationSetting)

設定報表伺服器的安全連接層級。

語法

Public Sub SetSecureConnectionLevel(Level as Integer, _
    ByRef HRESULT as Int32)
public void SetSecureConnectionLevel(Int32 Level, 
    out Int32 HRESULT);

參數

  • Level
    代表安全連接層級的整數值。

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

傳回值

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

備註

呼叫時,報表伺服器的 SecureConnectionLevel 屬性會設定為指定的值。 值為 0 時,表示 SSL 為關閉狀態。 值大於或等於 1 時,表示 SSL 為開啟狀態。

  • 設定此值時,報表伺服器組態檔中的 SecureConnectionLevel 元素會變更,而且組態檔中的 URLRoot 元素會設定為使用 "https://" (如果指定的 Level 大於或等於 1) 或 "http://" (如果指定的 Level 為 1)。

在 SQL Server 2008 R2 中,SecureConnectionLevel 會變成 on/off 開關,預設值為 0。 對於大於或等於 1,且通過 SetSecureConnectionLevel 方法 API 的任何值,都會將 SSL 視為開啟狀態,並且在 rsreportserver.config 檔案中據此設定組態屬性 SecureConnectionLevel。 基於回溯相容性,仍然允許使用值 2 和 3。

需求

命名空間: root\Microsoft\SqlServer\ReportServer\<InstanceName>\v11\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 (所有版本)

請參閱

參考

MSReportServer_ConfigurationSetting 成員