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 为 0)。

在 SQL Server 2008 R2 中,SecureConnectionLevel 成为一个开关,默认值为 0。对于任何通过 SetSecureConnectionLevel 方法 API 传递的大于或等于 1 的值,SSL 将被视为打开,并且在 rsreportserver.config 文件中相应地设置配置属性 SecureConnectionLevel。将仍允许值为 2 和 3,以便向后兼容。

要求

命名空间: 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(所有版本)