3

How do one use PowerShell to update or change the RSReportServer.config file?

I want to change the value in the IsReportManagerEnabled tag, inside the Service tag, from True to False.

Thanks a lot.

Yster
  • 3,147
  • 5
  • 32
  • 48

1 Answers1

5

Per http://msdn.microsoft.com/en-us/library/bb630448.aspx , your config file is most likely in c:\Program Files\Microsoft SQL Server\MSSQL.n\Reporting Services\ReportServer\ but update the below to be correct for your system. And make a backup of the file before doing anything else.

[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")

You may need to restart the ReportServer service for this to take effect.

alroc
  • 27,574
  • 6
  • 51
  • 97
  • Thanks a million alroc. I'm sure it's going to work, but I'll test it tomorrow and mark the answer. – Yster Sep 12 '12 at 20:29
  • After changing the path to this: C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\RSReportServer.config , it ran without errors, but when checking the file, the value was still true. – Yster Sep 13 '12 at 07:17
  • 1
    Run Powershell as Administrator. Your regular user account, even though it may be in the Administrators group, probably doesn't have rights to edit the file. – alroc Sep 13 '12 at 10:28