以前一直用的是SSRS 2008,剛換了SSRS 2017,折騰了半天終於把ReportServer部署好下,下面說下如何進行匿名訪問,處理方法和SSRS 2008差不多,只是文件存放位置有些變動。
一、從網上下載一個匿名訪問的dll文件,Microsoft.Samples.ReportingServices.AnonymousSecurity.dll,放到ReportServer/bin路徑下面。SSRS 2017一般是這個目錄(C:\Progam Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer\bin)。
二、修改配置文件rsreportserver.config、rssrvpolicy.config和web.config,都是在C:\Program Files\Microsoft SQL Server Reporting Services\SSRS\ReportServer目錄下
1、修改web.config,找到下面代碼,註釋掉
<authentication mode="Windows" />
<identity impersonate="true" />
改爲下圖所示:
2、修改 rssrvpolicy.config配置文件,找到下面代碼
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="Nothing">
<IMembershipCondition
class="AllMembershipCondition"
version="1"
/>
在後面加上以下代碼,URL是之 前下載的匿名訪問dll文件路徑:
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="Private_assembly"
Description="This code group grants custom code full trust. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.AnonymousSecurity.dll"
/>
</CodeGroup>
3、修改rsreportserver.config文件,修改兩處,
第一處,找到代碼段<AuthenticationTypes><Custom/></AuthenticationTypes>
<AuthenticationTypes>
<RSWindowsNTLM/>
</AuthenticationTypes>
改爲:
<AuthenticationTypes>
<Custom/>
<!--<RSWindowsNTLM/>-->
</AuthenticationTypes>
第二處,找到以下代碼段
<Security>
<Extension Name="Windows" Type="Microsoft.ReportingServices.Authorization.WindowsAuthorization, Microsoft.ReportingServices.Authorization"/>
</Security>
<Authentication>
<Extension Name="Windows" Type="Microsoft.ReportingServices.Authentication.WindowsAuthentication, Microsoft.ReportingServices.Authorization"/>
</Authentication>
在後面代加下面代碼 :
<Security>
<Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.Authorization, Microsoft.Samples.ReportingServices.AnonymousSecurity"/>
</Security>
<Authentication>
<Extension Name="None" Type="Microsoft.Samples.ReportingServices.AnonymousSecurity.AuthenticationExtension, Microsoft.Samples.ReportingServices.AnonymousSecurity"/>
</Authentication>
以前幾處都改好後,重啓SSRS服務,大功告成!