【问题标题】:Using PowerShell to modify RSReportServer.config使用 PowerShell 修改 RSReportServer.config
【发布时间】:2012-09-12 13:48:55
【问题描述】:

如何使用 PowerShell 更新或更改 RSReportServer.config 文件?

我想将服务标记内 IsReportManagerEnabled 标记中的值从 True 更改为 False。

非常感谢。

【问题讨论】:

    标签: powershell config reportserver


    【解决方案1】:

    根据 http://msdn.microsoft.com/en-us/library/bb630448.aspx ,您的配置文件很可能在 c:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\ 中,但更新以下内容以适合您的系统。并在执行任何其他操作之前备份文件。

    [xml]$config = gc "c:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\RSReportServer.config"
    $config.SelectSingleNode("//IsReportManagerEnabled").InnerText = "False";
    $config.save("c:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\RSReportServer.config")
    

    您可能需要重新启动 ReportServer 服务才能使其生效。

    【讨论】:

    • 感谢一百万个 alroc。我确信它会起作用,但我明天会测试它并标记答案。
    • 将路径更改为: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\RSReportServer.config 后,它运行没有错误,但是在检查文件时, value 仍然是 true。
    • 以管理员身份运行 Powershell。您的普通用户帐户,即使它可能在管理员组中,也可能没有编辑文件的权限。
    猜你喜欢
    • 1970-01-01
    • 2020-08-18
    • 2016-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-30
    相关资源
    最近更新 更多